value of enter key

This is a discussion on value of enter key within the C++ Programming forums, part of the General Programming Boards category; i'm having a hard time finding info on this, so i'll just ask quickly. in a char array, i'm looking ...

  1. #1
    n3v
    n3v is offline
    irregularly symmetrical n3v's Avatar
    Join Date
    Mar 2006
    Location
    Finland
    Posts
    67

    value of enter key

    i'm having a hard time finding info on this, so i'll just ask quickly. in a char array, i'm looking for a particular letter. if the letter were "c", my program would be as follows

    Code:
    char example[15];
    if (example[12] == 'c') {
    // do stuff
    }
    however, i'm not looking for c, i'm looking for the enter key. what is it's value in a char array?
    Last edited by n3v; 05-29-2006 at 03:06 AM.
    If you make a man a fire,
    he will be warm for a day.
    If you set a man on fire,
    he will be warm for the rest of his life.

  2. #2
    Registered User
    Join Date
    Aug 2005
    Posts
    1,267
    The <Enter> key is '\n'. Note the double = symbol is boolean.

    if (example[12] == '\n') {

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Function to check memory left from malloc and free?
    By Lechx in forum C Programming
    Replies: 4
    Last Post: 04-24-2006, 05:45 AM
  2. Virtual keys
    By Arkanos in forum Windows Programming
    Replies: 4
    Last Post: 12-12-2005, 09:00 AM
  3. Dialog Edit Control and Enter Key
    By Quantrizi in forum Windows Programming
    Replies: 2
    Last Post: 04-14-2004, 07:59 AM
  4. Need to capture the enter key
    By tyouk in forum Windows Programming
    Replies: 7
    Last Post: 11-08-2003, 05:07 PM

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