如何解决Visual Studio-C ++新文件默认代码
大家好,我遇到的问题是Visual Studio 2017(由于学校需要,我使用2017)。 每当我启动一个新的C ++项目或C ++文件时,总是得到默认代码:
// ConsoleApplication4.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
每次删除它都很烦人,我很高兴知道如何删除默认代码。我搜索了Internet和Microsoft MSDN,但没有找到任何解决方案。谢谢您的帮助,这个网站对我有很大帮助!
解决方法
有两种方法可以创建一个空项目。
1.1创建一个项目。
1.2编辑项目,直到准备好将其导出为模板为止。例如,您可能要编辑代码文件以指示应在何处进行参数替换。请参见如何:在模板中替换参数。
1.3在Project
菜单上,选择Export Template
。
打开导出Template Wizard
。
1.4在“选择模板类型”页面上,选择Project Template
。选择要导出到模板的项目,然后选择Next
。
1.5在“选择模板选项”页面上,输入模板的名称和可选说明,图标以及预览图像。这些项目将显示在创建新项目的对话框中。选择Finish
。
- 您可以使用
Windows Desktop Wizard
。
然后选择Empty Project
。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。