Visit the LQ Articles and Editorials section
Go Back > Blogs > sumeet inani
User Name


Rate this Entry

how to compile c program in linux

Posted 03-15-2011 at 01:25 AM by sumeet inani

In windows , I used to run borland C++ compiler which also provides help on all functions defined in various libraries.

In ubuntu 10.04 I do
gcc c_program.c
It will provide error output , if any. Otherwise produce a.out in current folder which can be executed
In one of my threads I learnt that you should end printf with '\n' so that buffered output is flushed on screen.
You can also use 'fflush(stdout);'
Posted in Uncategorized
Views 2204 Comments 1
« Prev     Main     Next »
Total Comments 1


  1. Old Comment
    A habit should be developed to compile always with:
    gcc c_program.c -Wall -Wextra
    Posted 03-15-2011 at 04:30 AM by TheIndependentAquarius TheIndependentAquarius is offline


All times are GMT -5. The time now is 08:00 PM.

Main Menu

Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration