error C2065: 'cout' : undeclared identifier

前端 未结 25 2219
误落风尘
误落风尘 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:39

    In VS2017, stdafx.h seems to be replaced by pch.h see this article,

    so use:

    #include "pch.h"
    #include 
    
    using namespace std;
    
    int main() {
        cout << "Enter 2 numbers:" << endl;
    

提交回复
热议问题