[英]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.