iostream is a header. conio.h is a header.
When you #include them, you are telling the compiler to take the contents of those headers and inject it into your program.
Headers are just source code files. They contain a bunch of code that is pre-made for you to use. Which header you want/need to include depends on which code you want to use.
For example, std::cin and std::cout (used for input/output to the console) are both declared in <iostream>. So if you want to use either of them, you must #include <iostream>.
The std::string class, which can be used to keep track of variable length strings, is defined in the <string> header. So if you want to use that class in your code, then you must #include <string>
i dont know what that means coz i have seen lot of examples where different types of files are used not iostream or conio or any another file |
Those examples either would not compile, or they did not use anything from those headers.
IE, this program will compile fine without #including anything:
1 2 3 4
|
int main()
{
// do nothing
}
|
However, this program uses cout, so it must #include <iostream>. Without iostream, the compiler doesn't know what 'cout' is supposed to be:
1 2 3 4 5 6
|
#include <iostream>
int main()
{
std::cout << "example";
}
|
i dont know what are these files |
They're somewhere on your computer. It depends where you installed them.