#1
|
|||
|
|||
basic c programming annoying error
Hi, I'm starting to learn c from a textbook so that I can get on with a uni module in it that starts in a few weeks.
I've been working through the book for a few hours now, and I came across this example. I can't compile it, even though its an exact copy of teh example in the text book. Get an error, line 10: warning:new line not last character in file. I know that this is a really really basic mistake, but please point out what it is! #include <stdio.h> /* print Fahrenheit-Celcius table*/ main() { int fahr; for (fahr = 0; fahr <=300; fahr = fahr + 20) printf("%3d %6.1f \n", fahr, (5.0/9.0)*(fahr-32)); } thanks in advance - also the forum is removing all the tabs, but the program itself is indented. |
#2
|
|||
|
|||
Re: basic c programming annoying error
That is just a warning and would not stop the program from compiling. Make sure you check to see where the output executable file is going to be.
|
#3
|
|||
|
|||
Re: basic c programming annoying error
OMG im stupid.
I figured it out- didn't press return after the last line.. [img]/images/graemlins/blush.gif[/img] |
#4
|
|||
|
|||
Re: basic c programming annoying error
[ QUOTE ]
That is just a warning and would not stop the program from compiling. Make sure you check to see where the output executable file is going to be. [/ QUOTE ] Ah just tried running the output and its fine. Thanks for makeing that distinction for me! |
|
|