Can you give me an example of a new line character?

This is a discussion on Can you give me an example of a new line character? within the C++ Programming forums, part of the General Programming Boards category; Hello I was wondering if someone could give me an example of a new line character...I have an error in ...

  1. #1
    Registered User
    Join Date
    Apr 2003
    Posts
    5

    Post Can you give me an example of a new line character?

    Hello I was wondering if someone could give me an example of a new line character...I have an error in a rpogram I got and it says I am missing a semicolon....I think the new line character goes something like this
    cout<<"Something \n";
    is that right?

  2. #2
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398

    Check the line above...

    I've seen that error before! "Newline in constant"? Make sure your quotes are all there... that they're matched. Check the line(s) above the line pointed-to by the compiler.

    Sometimes the compiler gets confused. It knows there is an error, but it may NOT know exactly what or where the error is! It doesn't know where you want to put the quotes, or where you want to end the statement with a semicolon.

    Make sure your brackets are matched too.

    Does it compile with that line commented-out?

    Try commenting-out lines 'till the error goes away. Be careful when commenting-out lines. Keep the brackets matched. Make sure the functions still have return statements. Make sure variables are declared, etc.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Pointer and Polymorphism help.
    By Skyy in forum C++ Programming
    Replies: 29
    Last Post: 12-18-2008, 09:17 PM
  2. Printing Length of Input and the Limited Input
    By dnguyen1022 in forum C Programming
    Replies: 33
    Last Post: 11-29-2008, 04:13 PM
  3. about wide character and multiple byte character
    By George2 in forum C Programming
    Replies: 3
    Last Post: 05-22-2006, 09:11 PM
  4. Character problem!!
    By cBegginer in forum C Programming
    Replies: 3
    Last Post: 09-03-2005, 12:51 AM
  5. syntax error when defining vectors
    By starkhorn in forum C++ Programming
    Replies: 5
    Last Post: 09-22-2004, 01:46 PM

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