Sunday 20 October 2013

compile c program in linux

hello frickies....
Here i'll teach you how to compile and run your c program in linux operating system.
First you go to your directory where your .c extension file present in your computer.As an example in my case it is in Desktop directory.I am using BackTrack OS which is also a family of Linux OS. You can also write your c code in vi or emac or any editor in linux.
Once you have written your c program you can see it using 'ls' command.As you can see in image below.


In my case there is 1.c is c file. After that type
gcc -o abc abc.c
 here -o abc create executable file in same directory with name abc.
You can see it using ls command

After compiling your program to execute it try out this command
./abc

and here you have done.
Keep watching to stay update with us.
Thank You.

No comments:

Post a Comment