Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Including In C++

Tags:

c++

include

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!

like image 875
ʇolɐǝz ǝɥʇ qoq Avatar asked Aug 25 '26 00:08

ʇolɐǝz ǝɥʇ qoq


2 Answers

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.

like image 181
bentank Avatar answered Aug 26 '26 14:08

bentank


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.

like image 43
Captain Giraffe Avatar answered Aug 26 '26 15:08

Captain Giraffe



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!