Switch to full style
C++ code examples
Post a reply

compare two strings

Thu Nov 13, 2008 7:21 pm

Code:
 
#include <iostream.h>
#include <string>
using std::string;

main(void)
{
   string s1 = "abcdefghijk", s2 = "1234567890", s3,s4,s5;

   s3=s1+s2;
   cout << s3 <<endl;

   s4=s3;
   if (s4==s3) 
      cout 
<< " s4==s3 is true\n";

   return(0);
}

/* 
abcdefghijk1234567890
 s4==s3 is true

*/
 




Post a reply
  Related Posts  to : compare two strings
 Compare two strings in php     -  
 compare strings     -  
 compare strings with if statement in php     -  
 Sort strings java-Sorting Array of Strings     -  
 compare two sets     -  
 Compare directories     -  
 String compare equality     -  
 How to compare two arrays in java     -  
 Use the boolean compare operators     -  
 Integer value compare with equal sign     -  

Topic Tags

C++ Strings