char and ascii

This is a discussion on char and ascii within the C Programming forums, part of the General Programming Boards category; if I want to see if TempChar (type char) is a carriage return, what is the value of carriage return? ...

  1. #1
    Unregistered
    Guest

    char and ascii

    if I want to see if TempChar (type char) is a carriage return, what is the value of carriage return?
    ex: if (TempChar==??) where ?? is the value of the carriage return.
    I tried '13', '\r' but it didn't work.
    please help.

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,417
    The ANSI-C end of line character is line feed, which is written as '\n'.

  3. #3
    Unregistered
    Guest
    thanks.
    it works.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 4
    Last Post: 02-21-2009, 02:12 PM
  2. C++ ini file reader problems
    By guitarist809 in forum C++ Programming
    Replies: 7
    Last Post: 09-04-2008, 06:02 AM
  3. Code review
    By Elysia in forum C++ Programming
    Replies: 71
    Last Post: 05-13-2008, 09:42 PM
  4. Replies: 11
    Last Post: 03-24-2006, 10:26 AM
  5. Checking ascii values of char input
    By yank in forum C Programming
    Replies: 2
    Last Post: 04-29-2003, 07:49 AM

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