Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Sep 10th, 2008, 8:58 AM   #1
Herbststurm
Newbie
 
Join Date: Sep 2008
Location: Freiburg i. Brsg. Germany
Posts: 5
Rep Power: 0 Herbststurm is on a distinguished road
Send a message via ICQ to Herbststurm
Question my first c program - problems & questions

Hello,

I have written my wirst program in c. For you, it is probably trivial but learning by doing. The code is:

#include <stdio.h>

int main()
{
printf("Hello World!\n");
return 0;

}

I saved it as area51.c
Then I opened my console and put in: (I am using OpenSuse as OS)

gcc area51.c -o area51

and I got this message:

Quote:
warning: no newline at end of file
Now I don't know whats the problem.

In case, I set grammatical mistakes or improper vocabulary, please feel free to correct me.
Thanks for help
all the best
Herbststurm is offline   Reply With Quote
Old Sep 10th, 2008, 9:02 AM   #2
Klarre
Game engine designer
 
Klarre's Avatar
 
Join Date: May 2005
Location: Sweden
Posts: 314
Rep Power: 4 Klarre is on a distinguished road
Re: my first c program - problems & questions

Place the cursor after the '}' and press the enter key - the warning will be gone!
__________________
http://www.klarre.se
Klarre is offline   Reply With Quote
Old Sep 10th, 2008, 9:19 AM   #3
Herbststurm
Newbie
 
Join Date: Sep 2008
Location: Freiburg i. Brsg. Germany
Posts: 5
Rep Power: 0 Herbststurm is on a distinguished road
Send a message via ICQ to Herbststurm
Re: my first c program - problems & questions

Quote:
Originally Posted by Klarre View Post
Place the cursor after the '}' and press the enter key - the warning will be gone!
It worked

Herbststurm is offline   Reply With Quote
Old Sep 10th, 2008, 7:34 PM   #4
null_ptr0
12 years old
 
Join Date: Nov 2007
Posts: 105
Rep Power: 0 null_ptr0 is an unknown quantity at this point
Re: my first c program - problems & questions

for some reason all C source files that are not empty require a new line at the end or 'undefined' behavior may result. i knew why but i forgot
null_ptr0 is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Language display in program Prm753 C++ 3 May 30th, 2006 6:45 PM
Inheritance and polymorphism exercise problems, plus other questions codylee270 C++ 1 Apr 19th, 2006 11:29 PM
ucf cs student has some questions raspberryh Coder's Corner Lounge 33 Sep 12th, 2005 3:49 PM
crack these questions if u can!!! shagan C++ 18 Apr 3rd, 2005 7:47 AM
ATM Program Assignment problems sammyturncoat C++ 1 Mar 14th, 2005 7:37 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 5:40 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC