Visual C++2010的使用

Tools->Settings>Rest... 还原所有设置

运行程序:"D:Program FilesVCExpressInstallMicrosoft Visual Studio 10.0Common7IDEVCExpress.exe"

一、Visual C++2010(微软vc2010)如何编写并运行C++程序?

1、刚开始打开vc2010编译器的时候是一个start page 页面。根据页面的New Project. . .提示选项新建一个项目。

2、选择Win32 Console Application(win32控制台程序),键入项目名。

 

3、新建一个win32的空工程Empty project。

4、新建后的界面如下图所示。

5、选中项目名,添加一个新项目。右键Add -> New Item。在文件类型中选择C++ file。

6、在菜单栏的空白处点击右键添加快捷按钮,点击Build,菜单栏显示Build按钮。

7、编写程序如下图所示,编写完后按build 和 Start Debugging按钮。对应位置如图所示。程序运行。

今天初次使用VS2010版本,在coding完一个工程后,报错:

LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt

编译也没有任何错误,链接一直报错,也找不出什么原因,上网找了找,是工具的原因。

Microsoft Visual Studio 2010 英文版

Project->xx Properties

Manifest->Input and Output->Embed Manifest

将yes修改为no

再重新编译OK了

microsoft visual c++ 2010 express will run for 22 more days

visual c++ 2010 express注册码

6VPJ7-H3CXH-HBTPT-X4T74-3YVY7

那么我们怎么来写一个C语言程序呢?

和创建c++程序一样

我就写了如下C程序,按F5后运行一下就没了,怎么解决呢?

有两种方法:(一)Ctrl+F5可以解决:最后运行到的结果

方法二:

加system(“pause”);但是头文件要改变为c++标准头文件

#include<iostream>

using namespace std;

加好了再按F5就可以了。

#include <stdio.h>

int main()
{
    printf("Hello World");
    return 0;
}

如何自定义C语言.h头文件?

hello.h

// 打开h文件,进行编辑。建立头文件是有一定步骤的。要用到#ifndef。。。#define。。。。#endif。这是为了避免重复定义
// #ifndef后面要写的是头文件名称的大写。例如:test.h要写成__TEST_H__。前面与后面是两个下划线。字母用大写
#ifndef __HELLO_H__
#define __HELLO_H__

void hello();

#endif // 1

 aa.cpp

#include <stdio.h>
#include "hello.h";

int main()
{
    hello();
    return 0;
}

hello.cpp

#include <stdio.h>
#include "hello.h";

void hello(void)
{
    printf("Hello World
");
}

参考地址:https://jingyan.baidu.com/article/6b97984dcfd2991ca2b0bf03.html

参考地址:https://blog.csdn.net/zhanshen112/article/details/80193797

原文地址:https://www.cnblogs.com/jiangxiaobo/p/11166917.html