![](/img/trans.png)
[英]Why do i have to #include “stdafx.h” in Microsoft visual studio c++ applications?
[英]why I cant run this why this c++ code giving errors in visual studio ,though it is running well in code blocks after deleting #include "stdafx.h"
为什么这个 C++ 代码在 Visual Studio 中出错,尽管它在删除 #include "stdafx.h" 后在代码块中运行良好
#include "stdafx.h"
#include <iostream>
using namespace std;
void chintumal();
int main() {
chintumal();
return 0;
}
void chintumal() {
cout << "this is anurag pradhan ! \n";
}
您的代码中只能有一个main
函数。 看起来您在ConsoleApplication1.cpp
文件中定义了另一个main
。
实际上我是一个初学者,因此面临一些小问题,实际上我在 Visual Studio 中做了一个项目,并在同一个项目中创建了两个文件,每个文件都有一个主要功能,因此我的代码没有运行!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.