so i am in the process of learning C++ and am reading a book on it, one of the programs it has you make is:
Code:
#include <iostream>
using namespace std;
typedef unsigned short int SMALLNUMBER;
int main()
{
SMALLNUMBER = 65535;
cout << "small number:" << SMALLNUMBER << endl;
SMALLNUMBER++;
cout << "small number:" << SMALLNUMBER << endl;
SMALLNUMBER++;
cout << "small number:" << SMALLNUMBER << endl;
return 0;
}
the code above is exactly how it appears in the book, but geany is giving me these errors:
Code:
g++ -Wall -c "exersize8.cpp" (in directory: /home/neo/Documents/c++/exercises)exersize8.cpp: In function ‘int main()’:
exersize8.cpp:9:14: error: expected unqualified-id before ‘=’ token
exersize8.cpp:10:41: error: expected primary-expression before ‘<<’ token
exersize8.cpp:11:13: error: expected unqualified-id before ‘++’ token
exersize8.cpp:12:41: error: expected primary-expression before ‘<<’ token
exersize8.cpp:13:13: error: expected unqualified-id before ‘++’ token
exersize8.cpp:14:41: error: expected primary-expression before ‘<<’ token
Compilation failed.
now i have no idea why these have popped up but some help would be great
Bookmarks