Thread: a question about "new line

  1. #1
    Registered User
    Join Date
    Jan 2007
    Posts
    72

    Unhappy a question about "new line

    how can we check wether there is a new line or not
    i used this piece of code
    Code:
    if(char==\n)

  2. #2
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,210
    Yes, except:

    • char can't/shouldn't be the name of a variable.
    • You have to put the \n in single quotes, like this: '\n'

  3. #3
    Registered User
    Join Date
    Jan 2007
    Posts
    72
    thanks

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Advanced C Question: #line and #ifndef stuff
    By Paul22000 in forum C Programming
    Replies: 30
    Last Post: 11-11-2008, 03:10 AM
  2. fseek question regarding line number
    By DB66 in forum C Programming
    Replies: 1
    Last Post: 10-18-2008, 07:23 PM
  3. beginners question: write onto command line
    By xximranxx in forum Windows Programming
    Replies: 7
    Last Post: 05-05-2007, 08:49 AM
  4. Command Line arguments question
    By micpi in forum C Programming
    Replies: 7
    Last Post: 04-24-2007, 08:46 PM
  5. Command Line parameters question
    By Cbuild in forum C Programming
    Replies: 4
    Last Post: 11-26-2003, 08:30 PM