beginner...HELP! PLEASEEEEE

This is a discussion on beginner...HELP! PLEASEEEEE within the C Programming forums, part of the General Programming Boards category; 12 undefined undefined i try to do a simple .c file and it says "warning: no newline at end of ...

  1. #1
    <3 girls, britney, ashlee
    Join Date
    Jun 2004
    Posts
    1

    Question beginner...HELP! PLEASEEEEE

    12undefinedundefined
    i try to do a simple .c file and it says "warning: no newline at end of file" can someone tell me why? e-mail me if you want. thanks.
    ~MJ~

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Perhaps you should add a new line to end the file.

    Quzah.
    Hope is the first step on the road to disappointment.

  3. #3
    Registered User
    Join Date
    Jun 2004
    Posts
    93
    Quote Originally Posted by quzah
    Perhaps you should add a new line to end the file.

    Quzah.
    Where'd you get that idea?

    That's just crazy enough to work.

    If you post the code though MJ, people will have a better idea.

  4. #4
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,443
    > If you post the code though MJ, people will have a better idea.
    Because a missing newline shows up really well when posted on the board right?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  5. #5
    Registered User
    Join Date
    Jun 2004
    Posts
    93
    Quote Originally Posted by Salem
    Because a missing newline shows up really well when posted on the board right?
    Don't be silly, you can't post something that's missing.

  6. #6
    Registered User
    Join Date
    Jun 2004
    Posts
    1
    If you post nothing in the woods, and no one is there to read it, does it generate a new line?

  7. #7
    ---
    Join Date
    May 2004
    Posts
    1,379
    Quote Originally Posted by swampwaterwes
    If you post nothing in the woods, and no one is there to read it, does it generate a new line?
    your first post here and that is the best you can come up with?

  8. #8
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    >your first post here and that is the best you can come up with?
    I've seen worse.
    My best code is written with the delete key.

  9. #9
    Me -=SoKrA=-'s Avatar
    Join Date
    Oct 2002
    Location
    Europe
    Posts
    448
    Anyway...
    The reason you should put a blank line at the end of your files is that when the preprocessor joins the suorces into a single file, you could get the last word of the header as part of the first word of the source file.
    Adding a blank line avoids any problems you may have because of that. Also, it removes the warning.
    SoKrA-BTS "Judge not the program I made, but the one I've yet to code"
    I say what I say, I mean what I mean.
    IDE: emacs + make + gcc and proud of it.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Same old beginner question...
    By Sharmz in forum C Programming
    Replies: 15
    Last Post: 08-04-2008, 11:48 AM
  2. Replies: 5
    Last Post: 09-05-2005, 06:26 AM
  3. What are some good beginner programs I shouold make?
    By oobootsy1 in forum C# Programming
    Replies: 6
    Last Post: 08-09-2005, 02:02 PM
  4. Windows programming for beginner (Absolute beginner)
    By WDT in forum Windows Programming
    Replies: 4
    Last Post: 01-06-2004, 10:21 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21