fork download
  1. #include <iostream>
  2. using std::cout;
  3. using std::endl;
  4.  
  5. int main ()
  6. {
  7. const char* p1 = "test";
  8. const char* p2 = "test";
  9. const char* p3 = "st";
  10. const char* p4 = "te";
  11.  
  12. cout << std::boolalpha;
  13. cout << ( p1 == p2 ) << endl;
  14.  
  15. cout << ( p1+2 == p3 ) << endl;
  16. cout << ( p1 == p4 ) << endl;
  17. }
Success #stdin #stdout 0s 4908KB
stdin
Standard input is empty
stdout
true
true
false