今天学习VS2013,写了几句极简单的C代码,运行出错:error: 'cout' : undeclared identifier
解决方法:
1.#include "stdafx.h" 写在第一句
2.加命名空间:
#include <iostream>
using namespace std;
解决程序运行结果闪退的方法:
system("pause");
本文介绍了如何解决在Visual Studio 2013中编写简单C++程序时遇到的编译错误“cout未声明”的问题,并提供了一个防止程序运行后立即关闭的解决方案。
今天学习VS2013,写了几句极简单的C代码,运行出错:error: 'cout' : undeclared identifier
解决方法:
1.#include "stdafx.h" 写在第一句
2.加命名空间:
#include <iostream>
using namespace std;
解决程序运行结果闪退的方法:
system("pause");

被折叠的 条评论
为什么被折叠?