Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is #include <string> header in chapter 3 necessary? #9

Open
joshuacook487 opened this issue Nov 23, 2020 · 1 comment
Open

Is #include <string> header in chapter 3 necessary? #9

joshuacook487 opened this issue Nov 23, 2020 · 1 comment

Comments

@joshuacook487
Copy link

Hi,

I just finished chapter 3 and I noticed my IDE has greyed out the header - #include - suggesting that it isn't necessary. The program appears to run fine with or without it.

I can't see anywhere std::string is used in the program. Is it being used somewhere I haven't noticed and my IDE thinks it is unnecessary because the header is implicit in - #include - or is this really not needed?

If std::string is used, is it considered good practice to make headers explicit, rather than implicit in C++?

@jesyspa
Copy link
Owner

jesyspa commented Jan 21, 2021

You're right, the include does not appear necessary; I suspect this is just a copy-paste from the previous chapter. Thanks for pointing it out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants