#include <windows.h>//系统会自动连接到指定的库文件lib
#include <stdio.h>//std  io  标准输入输出接口

int main()
{
	int select = ::MessageBox(NULL,"hello world","caption",MB_OKCANCEL);//::是全局函数
	if(select == IDOK)
	{
		printf("aaa");
	}
	else
	{
		printf("bbb");
	}
	return 0;
}

使用vs.net2008写C程序

可以创建C++项目

选择Win32 控制台应用程序,

在应用程序窗口选择空项目复选框,

然后在建好解决方案中添加C++ 文件(.cpp),

把文件名写成.c扩展名的。

创建完毕后,右击.c文件,

选择属性->高级->编译为C代码(/TC)即可。

相关文章:

  • 2022-01-26
  • 2021-04-18
  • 2021-07-23
  • 2021-12-04
  • 2021-06-10
  • 2022-01-30
  • 2021-05-18
  • 2021-08-08
猜你喜欢
  • 2021-12-22
  • 2021-08-11
  • 2022-12-23
  • 2021-10-31
  • 2021-09-28
  • 2021-12-12
  • 2021-10-05
相关资源
相似解决方案