error C2065: 'cout' : undeclared identifier

前端 未结 25 2143
误落风尘
误落风尘 2020-12-01 08:40

I am working on the \'driver\' part of my programing assignment and i keep getting this absurd error:

error C2065: \'cout\' : undeclared identifier

25条回答
  •  失恋的感觉
    2020-12-01 09:22

    Try it, it will work. I checked it in Windows XP, Visual Studio 2010 Express.

    #include "stdafx.h"
    #include 
    using namespace std;
    
    void main( ) 
    {
       int i = 0;
       cout << "Enter a number: ";
       cin >> i;
    }
    

提交回复
热议问题