I'm really new to C++ but i ahve a problem with cin and cout.

in a simple program like eg.

Code:
#include <iostream.h>
int main()
{
 int x;
 cin>>x;
 cout<<"Your number was "<<x;
 return 0;
}
I have used cin and cout thinking it would print the text in some sort of console window but instead it prints it in a text file called stdout. The input only works if I create another text file in the same folder called stdin and type the input in there and save before running the program. Is this what it should do. If so then what other functions could I used to make it print in a console window?
I am using Macintosh Programmers' Workshop on the Mac.

Thanks