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:
hiks....gaptek aku. gak ngerti apa nih maksudnya...:(
iya jg ya, maklum sy masih gablog (gagap bloging).. nanti blajar bikin puisi jg deh spt blognya lucy
samma aku jg ga ngerti bhs nya.. linux gitu.. :(
hmm.. makacih yah dah mampir ke blog mamanya zaki, sering2 main ya om :)
hm, informatif tapi mungkin agak bingung buat orang awam seperti saya. but keep writing..
Regards from Monrovia :)
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