**
用Visual Studio2017写出第一个C程序
**
我是第一次写博客,希望大家多多指正。
如果你想用VS写C程序,你就必须安装下面那个使用C++的桌面开发:
安装这个工具之后,才能进行C语言的编辑。
打开VS,点击左上角“文件”->“新建”->“项目”
打开“已安装”,找到“VS C++”,点击右边的“空项目”,下面有所创建的项目名称和位置,点击“确定”。
接下来,会在右边出现“解决方案资源管理器”,下面有你创建的项目,我创建了“C1”,在C1下有“源文件”,右击会出现“添加”,点击“添加”会出现“新建项”
之后将会出现下面的页面,点击“C++文件(.cpp)”,下方会出现名称,将“.cpp”的后缀名改为“.c”,".cpp"是C++的后缀名
接下来写代码
点击“项目”,在最后会找到此项目属性,我的是“C1属性”
接下来会出现“C1属性页面”,点击“C/C++”,右面会出现“SDL检查”,右边会出现一个乡下的箭头,选择“否”,点击右下角“应用”
再此页面点击左边“链接器”,点击“系统”,右边第一行会出现“子系统”,点击右边箭头,选择“控制台(/SUBSYSTEM:CONSOLE)”,点击右下角“应用”,点击“确定”
返回编写代码页面,直接点击“本地Windows调试器”,代码正确就会直接出现运行结果
这样第一个C语言代码就编写完成了。谢谢大家!!!