PDA

View Full Version : how to compile?



robinoud
November 24th, 2006, 11:54 AM
I create fist file to test ?
I begining to learn C language....
I write........

#include <stdio.h>
void main()
{
printf("hello");
}

my source is right?
1. how to compile & run this source?
I see help in program but I don't understand.
Thank you.

engineer
November 24th, 2006, 12:10 PM
to compile type


gcc -o programname filename.c

to run it, type


./programname

Arndt
November 24th, 2006, 04:07 PM
I create fist file to test ?
I begining to learn C language....
I write........

#include <stdio.h>
void main()
{
printf("hello");
}


Don't trust anyone who tells you that "void main()" is portable.