LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   How to program C in Linux command line (http://www.linuxquestions.org/questions/programming-9/how-to-program-c-in-linux-command-line-336690/)

backpacker 06-24-2005 03:41 AM

How to program C in Linux command line
 
How to edit source code(I can use editor vi?).How to compile,link and excute it?Where can I find
the tutorial about that?Thanks.

trevelluk 06-24-2005 03:52 AM

You can use vi or any other editor of your choice. To compile and link you use gcc:
gcc -o progname file1.c file2.c ....

And to run it, ./progname

trickykid 06-24-2005 05:58 AM

Moved: More suitable in Programming.

eigenyeugen 06-24-2005 05:59 PM

If you end up using more than one source file (as you should if you're writing anything but the smallest of programs) you should learn about makefiles. Googling "makefile tutorial" should give you loads of links.

johnMG 06-24-2005 06:57 PM

Learn vi, make, and what arguments you need to pass to gcc to compile and link your code the way you want.

Also read up on the LinuxQuestions wiki.


All times are GMT -5. The time now is 07:38 AM.