Tuesday, October 6, 2009

c program from a linux terminal

well here it is....how to run a C program from a linux terminal...
Distribution differences wont matter as these are the general steps::


Step 1 :

Creating a program...
U can choose any of the various editors...i chose vim.
And do not forget to save...
( U can alternatively create the file on any directory u want)

#vim hello.c

Step 2 :

#gcc hello.c


Step 3:

In olden days,,the output of the assemblers was stored in the file
a.out

so the trend continued...
and we execute this file

#./a.out

BINGO!!
enjoy..

No comments:

Post a Comment