使用CYGWIN的gcc编译hello world

2025-04-19 22:44:31

1、打开CYGWIN软件。

使用CYGWIN的gcc编译hello world

2、输入vim命令,进入文本编辑界面

使用CYGWIN的gcc编译hello world

3、按键盘上的i键,进去编辑状态。

使用CYGWIN的gcc编译hello world

4、编写hello world程序#include<stdio.h>i艘绒庳焰nt main(void){ printf("hello world");}

使用CYGWIN的gcc编译hello world

5、编写完成后,按Esc键后,再按:键,然后输入save hello.c,进行保存你编写的程序。

使用CYGWIN的gcc编译hello world

6、再按一下:键,输入quit退出编辑文本状态。

使用CYGWIN的gcc编译hello world

7、然后输入gcc hello.c -o hello,回车

使用CYGWIN的gcc编译hello world

8、输入ls显示文件,你会看到文件下面多了一个hello.exe,这就是编译后的结果。

使用CYGWIN的gcc编译hello world

9、输入./hello,执行编写好的程序。

使用CYGWIN的gcc编译hello world
声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢