Thread: need a little help with if statements and strings

  1. #1
    Registered User
    Join Date
    Dec 2001
    Posts
    104

    need a little help with if statements and strings

    Need to know the proper way to make this type of comparison.
    char *ChTest="test";
    int h2;
    if (ChTest=="test")h2 = 3;
    Thanks in advance.

  2. #2
    Mayor of Awesometown Govtcheez's Avatar
    Join Date
    Aug 2001
    Location
    MI
    Posts
    8,823
    Use strcmp

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem Using Strings in IF statements
    By Programmer3922 in forum C Programming
    Replies: 6
    Last Post: 08-02-2008, 01:36 PM
  2. sscanf and parsing strings
    By jco1323 in forum C Programming
    Replies: 4
    Last Post: 02-20-2008, 06:32 PM
  3. Using strings in if statements
    By Brittany in forum C Programming
    Replies: 5
    Last Post: 03-14-2005, 05:15 PM
  4. if statements using strings as the condition
    By trang in forum C Programming
    Replies: 7
    Last Post: 12-13-2003, 05:20 PM
  5. Switch statements for strings
    By cxs00u in forum C++ Programming
    Replies: 5
    Last Post: 04-17-2002, 03:38 PM