Thread: Comparing input with " ' " ?

  1. #1
    Registered User
    Join Date
    Oct 2010
    Posts
    21

    Comparing input with " ' " ?

    I want to run a simple if statement:

    Code:
    if(ch == " '  ");
    Of course this doesn't work I thought it would be simple just to declare it as its ASCII characters !.

    I'm sure theres a simple way to do this could someone please enlighten me.

    TIA

    I found the answer declare it like this:

    c='\''
    Last edited by Chems; 12-06-2010 at 09:41 PM. Reason: Answer Found

  2. #2
    Registered User
    Join Date
    Sep 2008
    Location
    Toronto, Canada
    Posts
    1,834
    Yes, you found your answer correctly.
    Code:
    if (ch == '\'') ...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. I would love some input on my BST tree.
    By StevenGarcia in forum C++ Programming
    Replies: 4
    Last Post: 01-15-2007, 01:22 AM
  2. About aes
    By gumit in forum C Programming
    Replies: 13
    Last Post: 10-24-2006, 03:42 PM
  3. Structure and Linked List User Input Question
    By kevndale79 in forum C Programming
    Replies: 16
    Last Post: 10-05-2006, 11:09 AM
  4. HELP! Reading from txt file and comparing to input
    By disco_dog in forum C Programming
    Replies: 7
    Last Post: 12-05-2004, 06:30 AM
  5. need help with some input
    By blindleaf in forum C Programming
    Replies: 2
    Last Post: 03-16-2003, 01:50 PM