1. 使用Notepad.exe(记事本)编辑如下代码,并保存为hello.c文件
#include <Windows.h>
int main()
{
MessageBox(NULL, "Hello", "Hello", MB_OK);
return 0;
}2. 使用cl.exe编译hello.c文件
cl.exe hello.c /link user32.lib
3. 运行hello.exe
本文介绍如何使用简单的记事本编辑器编写C代码,并通过Microsoft的CL编译器来编译生成一个显示消息框的应用程序。文章详细说明了创建源文件、编译过程及链接步骤,最终生成可执行文件。
1. 使用Notepad.exe(记事本)编辑如下代码,并保存为hello.c文件
#include <Windows.h>
int main()
{
MessageBox(NULL, "Hello", "Hello", MB_OK);
return 0;
}2. 使用cl.exe编译hello.c文件
cl.exe hello.c /link user32.lib

被折叠的 条评论
为什么被折叠?
