visual studio 2012 c++ hello world - iostream not working

前端 未结 6 932
轮回少年
轮回少年 2021-02-08 21:48

I have an issue with Visual Studio\'s 2012. I am also using \"Sams Teach Yourself C++ in One Hour a day, 7th edition\".

After using google to find the \"best\" compilers

6条回答
  •  南方客
    南方客 (楼主)
    2021-02-08 22:52

    In order to fix your error you have to delete std:: of std::cout and std::endl, and write using namespace std; underneath #include iostream and and change “ ” with " ".

    #include 
    using namespace std;
    int main() 
    {
       cout <<"Hello World" << endl;
       return 0;
    }
    

    In Visual studio 2012

     file>new projet>visual c++ (Project win32)>application settings(application console+Not Using Precompiled)>in right box in you Project (right click, add>new element>file c++).
    

提交回复
热议问题