Two Plus Two Newer Archives  

Go Back   Two Plus Two Newer Archives > Other Topics > Computer Technical Help
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 01-21-2007, 08:15 AM
jk1986 jk1986 is offline
Senior Member
 
Join Date: Aug 2006
Location: London
Posts: 775
Default 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.
Reply With Quote
  #2  
Old 01-21-2007, 08:23 AM
pokergrader pokergrader is offline
Senior Member
 
Join Date: Apr 2005
Posts: 3,792
Default 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.
Reply With Quote
  #3  
Old 01-21-2007, 08:23 AM
jk1986 jk1986 is offline
Senior Member
 
Join Date: Aug 2006
Location: London
Posts: 775
Default 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]
Reply With Quote
  #4  
Old 01-21-2007, 08:25 AM
jk1986 jk1986 is offline
Senior Member
 
Join Date: Aug 2006
Location: London
Posts: 775
Default 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!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:44 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.