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) #include<math.h> #include<stdio.h> int main(void) { int a; int b; a = 1; b = 2; printf(" PLEASE"); printf("a=%2d",a); printf("b=%2d",b); } 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? thanks |
you need a new line character, \n, to flush the output buffer for you each line.
|
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 ./yourprog |
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 02:34 PM. |