Skip to content

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

Description

@joshuacook487

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++?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions