I was doing the example in the tutorial and When I tried to run the program I got few error. Some of them I do not understand such as the file and directory is not there. cin is not identified. It also said there an error on iostream. I am using the compiler that this site directed me.(codeblock VB 2005/08) I really appreciate any feedback.
Code:
#include <iostream>
using namespace std;
int main ()
{
int age;
cout<<"Please enter your Age";
cin >>age;
cin.ignore ();
if ( age< 100)(
cout<<"You are pretty young!\n";
)
else (age ==100)(
cout<<"You are really old\n";
)
cin.get();
}
,
Code:
C:\Users\gameffect\Documents\first1\if statements.c|1|error: iostream: No such file or directory|
C:\Users\gameffect\Documents\first1\if statements.c|3|error: expected '=', ',', ';', 'asm' or '__attribute__' before 'namespace'|
C:\Users\gameffect\Documents\first1\if statements.c||In function 'main':|
C:\Users\gameffect\Documents\first1\if statements.c|9|error: 'cout' undeclared (first use in this function)|
C:\Users\gameffect\Documents\first1\if statements.c|9|error: (Each undeclared identifier is reported only once|
C:\Users\gameffect\Documents\first1\if statements.c|9|error: for each function it appears in.)|
C:\Users\gameffect\Documents\first1\if statements.c|10|error: 'cin' undeclared (first use in this function)|
C:\Users\gameffect\Documents\first1\if statements.c|14|error: expected ')' before ';' token|
C:\Users\gameffect\Documents\first1\if statements.c|16|error: expected ';' before 'else'|
||=== Build finished: 8 errors, 0 warnings ===|