Many of the old header files were standardized a few years back, so that a given set of instructions could be used regardless of which compiler you use. To differentiate between the old headers and the new ones, the .h was removed from them. So #include <iostream.h> is now just #include <iostream> as well as many others, I don't have the complete list, but it should be simple enough to google.
As well as the new headers was the inclusion of the standard namespace. Any objects in the new header files, such as cout and cin, are found in the namespace std, and can be accessed either individually, like so
- Code: Select all
std::cout << "BLAH" <<std::endl;
or globally, by putting the following line under your includes
- Code: Select all
#include <iostream>
using namespace std;
int main() {
// bunch of other code here
cout << "BLAH" << endl; // note I didn't put std::
// and any other code, whatever
};
then just using cout as normal, without the std:: in front. Namespaces are useful, but for a beginner who doesn't need to worry about them, just put the using line I mentioned early under your includes, and you shouldn't need to worry about it for now, just do some reading when you get the chance.