我正在使用Visual Studio 2019,每当我创建一个新的C ++项目时,它将使用以下代码为我提供一个默认文件:
// Template Test.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
int main()
{
std::cout << "Hello World!\n";
}
// Run program: Ctrl + F5 or Debug > Start Without Debugging menu
// Debug program: F5 or Debug > Start Debugging menu
// Tips for Getting Started:
// 1. Use the Solution Explorer window to add/manage files
// 2. Use the Team Explorer window to connect to source control
// 3. Use the Output window to see build output and other messages
// 4. Use the Error List window to view errors
// 5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project
// 6. In the future, to open this project again, go to File > Open > Project and select the .sln file
这是太多不必要的信息,需要一分钟时间将其更改为我真正想要的;
// Template Test.cpp : This file contains the 'main' function. Program execution begins and ends there.
#include <iostream>
using namespace std;
int main() {
cout << "Hello World!\n";
}
这并不需要很多时间,但是每次在VS 19中创建新的C ++控制台项目时,我都必须这样做。
在我的计算机上进行了快速搜索之后,我在以下位置找到了一个名为“模板”的文件夹:
C:\ Users \ yale \ Documents \ Visual Studio 2019 \ Templates
此文件的子目录会让我认为这是正确的位置,但是据我所知,这些文件夹都没有任何模板文件。
如何使用Visual Studio 2019修改C ++中不同项目的模板文件?
答案 0 :(得分:0)
您可以通过两种方式选择它们。
使用导出模板向导:
Visual Studio提供了可用于更新现有模板的导出模板向导:
要手动更新现有模板,请执行以下操作:
此外,您可以访问source page了解更多详细信息。