[Linux] C language and Helloworld and helloworldc language are written in Ubuntu12.04.
Ubuntu12.04 comes with a C environment, which is much better than a C environment developed by Windows. This C is the C language that everyone wants to learn.
Especially in the C language of the year, the next VC6 egg hurts, and then kakaka, the error is prompted in English, it is very uncomfortable.
The process for writing C in Ubuntu is as follows.
1. Press Ctrl + Alt + R to open the terminal and enter:
gedit helloworld.c
Create a. c file.
2. Open a notepad page for you to write. Like a NotePad, keyword highlighting is much better than VC6's interface, and there is no Visual Studio card.
Enter Helloworld in the following C language. Don't talk about this Helloworld ...... It is said that members of the liberal arts computer group understand.
#include<stdio.h>void main(){printf("hello world\n");}
Let's put it in one sentence. I am in a good mood today. Don't discuss the problems between the main function int main () and void main () with me. OK?
3. Save and exit, and return to the terminal to continue the input. The output of Helloworld is displayed.
gcc helloworld.c -o helloworld./helloworld
As shown in:
The first sentence above is to compile helloworld. c into a helloworld executable program in Linux.
The second sentence is to run the executable file helloworld.
4. Now I have written the helloworld program. It is said that American computer colleges and universities must specify to write C in this way, and VC6 will be despised.
In fact, your helloworld. c and helloworld executable programs are in your main folder, that is,/pc/home/, where pc is the user name.