well, I'm using a book called "Learn C++ in 21 days" and it's working out great so far. The only problem is that when I type in the code from the book, letter for letter, many errors pop up. Is this book made for a previous version of C++? It was writtin at least 5 years ago, and the verion of C++ I'm using is "Dev-C++ v.5"...
Anyone know of this problem? Is there actually a problem with this code? Heres an example of the book's code
#include <iostream.h>
void myFunction();
int x = 5, y = 7;
int main()
{
cout << "x from main: " << x << "/n";
cout << "y from main: " << y << "/n/n";
myFunction();
cout << "Back from myFunction!/n/n";
cout << "x from main: " << x << "/n";
cout << "y from main: " << y << "/n";
return 0;
}
void myFunction()
{
int y = 10;
cout << "x from myFunction: " << x << "/n";
cout << "y from myFunction: " << y << "/n/n";
}
So, obviously it's just a simple little program, not really doing much, but it won't work!
Someone know how to fix my problem?
Also, one of the errors at the bottom of the page is "32:2 C:\Dev-Cpp\include\c++\3.4.2\backward\backward_warning.h #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated. "
heh, anyone know this one?