Comparing 2 Strings

This is a discussion on Comparing 2 Strings within the C++ Programming forums, part of the General Programming Boards category; how do i compare two stings (character arrays) to see if they are identical?...

  1. #1
    Unregistered
    Guest

    Arrow Comparing 2 Strings

    how do i compare two stings (character arrays) to see if they are identical?

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    strcmp(str1,str2)

    returns 0 on successfull match

  3. #3
    Unregistered
    Guest
    under what header?

  4. #4
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    <string.h>

  5. #5
    Unregistered
    Guest
    thanks

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 04-29-2009, 10:13 AM
  2. Problem with comparing strings!
    By adrian2009 in forum C Programming
    Replies: 2
    Last Post: 02-28-2009, 09:44 PM
  3. comparing strings using argv
    By eth0 in forum C Programming
    Replies: 2
    Last Post: 09-20-2005, 09:20 AM
  4. comparing strings
    By infinitum in forum C++ Programming
    Replies: 1
    Last Post: 05-03-2003, 12:10 PM
  5. Comparing Strings
    By Perica in forum C++ Programming
    Replies: 6
    Last Post: 02-12-2003, 10:41 PM

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