Whats wrong with my code ?

So i build my program

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include <iostream>
#include <cstdlib>
#include <cstdio>

//This part of the code
//initialazies the main part of the code

//Then ask's the user for the yeae they were born in

int main (int nNumberofArgs, char* pszArgs [])
{
    int nYear;
    cout << "Enter your birth year: ";
    cin >> nYear;

    //Meke Determination of Century.

    if (nYear > 2000)
    {
        cout << "You were botn in the 21st Century";
        endl;
    }
    else
    {
        cout << "You were born in ";
        if (nYear > 1950)
        {
            cout << "The second half";
        }
        else
        {
            cout << "The First Half";
        }
        cout << "Of the 20th Century"
            <<endl;
    }

    system ("PAUSE");
    return 0;

}


and get this error's
1
2
3
4
5
6
7
8
9
Compiling: main.cpp
J:\C++ PROJECTS\The Game\main.cpp: In function 'int main(int, char**)':
J:\C++ PROJECTS\The Game\main.cpp:13: error: 'cout' was not declared in this scope
J:\C++ PROJECTS\The Game\main.cpp:14: error: 'cin' was not declared in this scope
J:\C++ PROJECTS\The Game\main.cpp:21: error: 'endl' was not declared in this scope
J:\C++ PROJECTS\The Game\main.cpp:35: error: 'endl' was not declared in this scope
Process terminated with status 1 (0 minutes, 1 seconds)
4 errors, 0 warnings
 
This is a classic error that I used to make from time to time.

Aren't you forgetting a using namespace std; somewhere?

-Albatross
Omg i did not see that , thanks man
Topic archived. No new replies allowed.