LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Blogs > sumeet inani
User Name
Password

Notices

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
Code:
gcc c_program.c
It will provide error output , if any. Otherwise produce a.out in current folder which can be executed
Code:
./a.out
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 2154 Comments 1
« Prev     Main     Next »
Total Comments 1

Comments

  1. Old Comment
    A habit should be developed to compile always with:
    Code:
    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 09:30 PM.

Main Menu
Advertisement

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