2017-02-21 99 views
2

我的意思是,我們總是得到這樣的代碼:如何更改在Visual Studio 2015中打開C++代碼的默認新項目?

// ConsoleApplication1.cpp : Defines the entry point for the console application. 
// 

#include "stdafx.h" 


int main() 
{ 
    return 0; 
} 

有什麼辦法來改變這種到另一個代碼?所以,當我開始一個新項目,我總是想要得到的東西是這樣的:

#include "stdafx.h" 
#include <iostream> 

using namespace std; 

    int main() 
    { 
     return 0; 
    } 

我知道這是不是一個很大的區別,但我真的不想總是編輯,有時無聊

+1

您可能需要閱讀[爲什麼使用命名空間std是不好的做法(http://stackoverflow.com/questions/1452721/why-is -using-namespace-std-considered-bad-practice) – rustyx

+1

你想把#include 放在stdafx.h預編譯的頭文件中,而不是別的地方。 –

+0

您可以創建自己的模具,而不是Microsoft爲您生成一個模具。好處是你可以使用你的編碼標準而不是微軟的標準。創建模具文件。在編輯之前複製它們。 –

回答

相關問題