# Microsoft Visual C++ 2008 Express Edition - Stdio Problem



## pcpro17 (Oct 9, 2006)

Hello. I'm using Microsoft Visual C++ 2008 Express Edition to write a program. At this point I'm just working on a Win32 Console App to develop some classes. Now I'm at a point where I need to add console I/O to test class functions. Unfortunately, for some reason the console I/O APIs don't seem to work. Has anybody run into this problem before or know how to fix it? Thanks.


----------



## mt2002 (Sep 14, 2005)

Post error messages and code.

Also, if you are using C++, you should be using <iostream> not <stdio.h>


----------



## pcpro17 (Oct 9, 2006)

When I add iostream.h to the top of main.cpp I get this error:


```
#include <iostream.h>
```


```
1>...filepath...(6) : fatal error C1083: Cannot open include file: 'iostream.h': No such file or directory
```
Without iostream I get this error:


```
cout << ">" << endl;
```


```
1>...filepath...(17) : error C2065: 'cout' : undeclared identifier
1>...filepath(17) : error C2065: 'endl' : undeclared identifier
```
My main function is pretty simple so far:


```
#include <stdafx.h>
#include <stdio.h>
//#include <iostream.h>
#include "game.h"

int _tmain(int argc, _TCHAR* argv[])
{
   c_game* game = new c_game;
   game->Init();

   do
   {
      cout << ">" << endl;
   }
   while( 1 );

   game->End();

   return 0;
}
```
Any suggestions?


----------



## mt2002 (Sep 14, 2005)

> When I add iostream.h to the top of main.cpp I get this error:


Its not <iostream.h> its just <iostream> (omit the *.h)

You may also need *using namespace std;* as you are using objects from that namespace. So it should be this:


```
#include <iostream>
using namespace std;
```


----------

