1. 程式人生 > >1、在Ubuntu中搭建C語言的編輯環境

1、在Ubuntu中搭建C語言的編輯環境

1、在Ubuntu中搭建C語言的編輯環境

 

1、安裝Ubuntu虛擬機器

2、安裝vim(編輯器),gcc(編譯器)和build-essential(編譯程式必須軟體包的列表資訊)

sudo apt

sudo apt-get install vim

sudo apt-get install gcc

sudo apt-get install build-essential

3、編寫hello world.c

1 #include<stdio.h>
2 int main()
3 {
4         printf("hello world\n");
5 return 0; 6 }

4、編譯:

1 gcc helloworld.c -o hello

 

5、執行:

1 ./hello

 

PS:  gcc helloworld.c   -- > helloworld.out