#programming: principals and practice using c++ (2nd edition) setup help

8 messages · Page 1 of 1 (latest)

shut verge
#

The absolute first program in the book—the hello world program—is not able to be completed since the book uses a custom header file for nearly all of its content. The std_lib_facilities.h header file isn’t listed on the authors website, nor can I find a valid solution to this problem. I can absolutely create my own header file with the same content and just copy and paste it into my project directory, but that’s too much work for each program that I plan on making.

Do I really need this custom header file, or could I just include whatever my compiler tells me I need? Also, The header file uses namespace std I believe so there’s no std:: or anything like that. Will I be getting into a bad habit and/or cheating myself out of a portion of learning by not including the needed header files on my own for each individual program?

stable peakBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.

upbeat lintel
#

It doesn't matter to include the std_lib_facilities..the code will compile fine without having to include that header file

#

You can compile your hello world program as usual

shut verge
#

How do I know what to include?

#

I’m new to this so I’m not sure what is what. If I only include iostream, do I still need std:: for cout? Since the book doesn’t use std:: how do I know when to use it?

heady birch
#

If you don’t use std:: for something that is in the std namespace your compiler will find it in the std namespace and ask if that was what you meant