OR statement within a "strcmp"

This is a discussion on OR statement within a "strcmp" within the C++ Programming forums, part of the General Programming Boards category; is it possible to use an OR statement within a strcmp?? such as...... Code: if (strcmp(pac101, info.college)==0 || strcmp(pac102, info.college)==0) ...

  1. #1
    Shake Zula- The Mic Rula!
    Join Date
    Sep 2004
    Posts
    69

    OR statement within a "strcmp"

    is it possible to use an OR statement within a strcmp??

    such as......

    Code:
    if (strcmp(pac101, info.college)==0 || strcmp(pac102, info.college)==0)
    {
           do some stuff
    }
    is this right??

  2. #2
    Registered User Tonto's Avatar
    Join Date
    Jun 2005
    Location
    New York
    Posts
    1,465
    Yes.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Usefulness of the "else if" statement
    By gn17 in forum C Programming
    Replies: 7
    Last Post: 08-12-2007, 06:19 AM
  2. Meaning of this statement?
    By @nthony in forum C Programming
    Replies: 7
    Last Post: 07-16-2006, 03:57 AM
  3. If Else statement problem
    By doofusboy in forum C Programming
    Replies: 2
    Last Post: 11-09-2005, 07:18 AM
  4. string & if statement
    By Curacao in forum C++ Programming
    Replies: 4
    Last Post: 05-02-2003, 10:56 PM
  5. Uh-oh! I am having a major switch problem!
    By goodn in forum C Programming
    Replies: 4
    Last Post: 11-01-2001, 04:49 PM

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