-   Programming (
-   -   No Output?? (

fernin8r 06-21-2003 03:24 AM

No Output??
This is really dumb, but i'm a newbie.

here's my code. (I'm just tried to familiarize myself with the gcc compiler)


int main(void)

int a;
int b;

a = 1;
b = 2;

printf(" PLEASE");


HERE's what i type in

gcc ~/filename.c

i got thing to run without errors, but were do the printf statements print to? i don't see " PLEASE" or "a=1" or "b=2". am i typing something in wrong?


acid_kewpie 06-21-2003 05:01 AM

you need a new line character, \n, to flush the output buffer for you each line.

Hko 06-21-2003 06:47 AM

cd ~
gcc -o yourprog filename.c

# now you program is compiled to the "yourprog" executable.
# and you need to run that to see some output


acid_kewpie 06-21-2003 07:52 AM

oh crap, i strike again... yeah, you only compiled the program, you didn't actually RUN it. right now you'll have a new program called a.out which is the compiled code.

All times are GMT -5. The time now is 05:54 AM.