Thread: Stupid question.. sorry..

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Young C n00b
    Join Date
    Jul 2006
    Posts
    59

    Stupid question.. sorry..

    what's wrong with this statement? I keep getting parse errors.

    Note: The variable q1 refers to a 'char' variable, declared as follows:

    Code:
     char q1 = 'y';
    Code:
    if  (q1=='y') or (q1=='Y')
       
    printf("Correct!");

    i've also tried adding braces..

    Code:
    if  (q1=='y') or (q1=='Y')
    {
       
    printf("Correct!");
    }
    and i've even tried without the parenthesis..

    Code:
    if  q1=='y' or q1=='Y'
       
    printf("Correct!");

    I just had this working!! I messed around with it a little, re-wrote it, and now I'm getting parse errors. Is it something i'm not seeing?

    Anyone know of a few code examples that use conditionals with operators? (and, or, not)
    Last edited by kwikness; 08-18-2006 at 10:33 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Stupid Question Probably
    By Kyrin in forum C Programming
    Replies: 2
    Last Post: 05-07-2006, 12:51 AM
  2. Replies: 7
    Last Post: 11-04-2005, 12:17 AM
  3. Stupid Question
    By digdug4life in forum C++ Programming
    Replies: 22
    Last Post: 05-17-2005, 11:43 AM
  4. stupid, stupid question
    By xelitex in forum C++ Programming
    Replies: 5
    Last Post: 12-22-2004, 08:22 PM
  5. Stupid question: What does Debugger do?
    By napkin111 in forum C++ Programming
    Replies: 6
    Last Post: 05-02-2002, 10:00 PM