Wednesday, January 04, 2006

Say Hello to vi and gcc

Category: Linux Redhat9 Tips

The following is very basic introduction to use gcc (GNU C Compiler) using vi as editor.

On shell prompt type this:

$ vi [ENTER]

The opening vi screen will be showed.
Type [INS] button to start editing.

Type these lines:

#include <stdio.h>

int main(void) {
printf("Hello World\n");
}


Type [ECS] to enter command mode (on the bottom of screen)
To save file:
:w test.c [ENTER]
To quit from editor:
:q [ENTER]

To compile, on shell prompt:
$ gcc test.c -o test [ENTER]

To run the program:
$ ./test [ENTER]

Result:
$ Hello World

see u..:)

5 Comments:

At 9:35 PM, Anonymous Anonymous said...

hiks....gaptek aku. gak ngerti apa nih maksudnya...:(

 
At 12:53 PM, Blogger kedip said...

iya jg ya, maklum sy masih gablog (gagap bloging).. nanti blajar bikin puisi jg deh spt blognya lucy

 
At 12:15 PM, Blogger Wina said...

samma aku jg ga ngerti bhs nya.. linux gitu.. :(
hmm.. makacih yah dah mampir ke blog mamanya zaki, sering2 main ya om :)

 
At 10:06 PM, Blogger L. Pralangga said...

hm, informatif tapi mungkin agak bingung buat orang awam seperti saya. but keep writing..

Regards from Monrovia :)

 
At 3:25 AM, Blogger kedip said...

makasih.. lusy n baby, emaknya zaki, luigi yg sedang tugas di afrika..
kl gue post gambar2 lucu dr majalah apa ngelanggar etika/copyright ga ya..
btw, sebetulnya sih posting2 yg sblmnya itu sangat basic. kl ada yg ngerti mungkin akan tersenyum2 krn sangat basic..:) tujuannya sih utk catatan dan sekedar introduksi yg mungkin bisa sbg starting point bg yg memerlukan.

 

Post a Comment

<< Home