ʇolɐǝz ǝɥʇ qoq
ʇolɐǝz ǝɥʇ qoq

Reputation: 734

Including In C++

In C++, you have to include certain libraries to use certain commands.
For example, you type #include <iostream> in order to use std::cout and std::cin.

I always forget what to include to use what commands, so I wonder if there is an easy way to remember, or if it's possible to include everything.

Any way to help me and other people out there who has this problem remember the different includes or a way to make including simpler is appreciated!

Upvotes: 3

Views: 199

Answers (3)

user3781490
user3781490

Reputation: 9

Just do a quick search of the command you're using, and the forum explaining the command should tell you which library/libraries are involved.

Upvotes: -1

bentank
bentank

Reputation: 616

Including everything would take forever to compile so that is not advised.

http://www.cplusplus.com/ can tell you what to include for almost anything you are going to need.

Also, you will start to remember them over time.

Upvotes: 3

Captain Giraffe
Captain Giraffe

Reputation: 14705

You can write programs like they are an essay. Take a look at literate programming.

For instance, at the literate programming wiki, you can find a hello world program that addresses all your concerns here.

Upvotes: 1

Related Questions