--- In [email protected], "devitoiniya" <[EMAIL PROTECTED]>
wrote:
> Hi
> I have typed in a c program using an editor and compiled with gcc. I 
> have compiled c programs in windows and found an exe file created. We 
> can run that file.
> In linux how to run a c program?
> Please help me with this.
> Thanks in advance.
> Usha

You can use -o [file] with gcc to name an output file.  If you want to
use the default, here's what the man page for gcc says (for gcc-3.3.5
on Gentoo Linux)

"If -o is not specified, the default is to put an executable file in
a.out, the object file for source.suffix in source.o, its assembler
file in source.s, and all preprocessed C source on standard output."

If the output file isn't executable, make it so with "chmod u+x a.out"
(assuming you used the default output file name).  Either execute it
with "./a.out" if it's in the current directory, or give it a name
(like mycprog) and copy it to a directory in your path ("cp a.out
/usr/local/bin/mycprog") and run it with "mycprog" from anywhere.

Martin





------------------------ Yahoo! Groups Sponsor --------------------~--> 
<font face=arial size=-1><a 
href="http://us.ard.yahoo.com/SIG=12h2gi7co/M=362329.6886308.7839368.1510227/D=groups/S=1705006580:TM/Y=YAHOO/EXP=1124309552/A=2894321/R=0/SIG=11dvsfulr/*http://youthnoise.com/page.php?page_id=1992
">Fair play? Video games influencing politics. Click and talk back!</a>.</font>
--------------------------------------------------------------------~-> 

To unsubscribe from this list, please email [EMAIL PROTECTED] & you will be 
removed. 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/LINUX_Newbies/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to