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