fork download
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <string>
  4. #include <sstream>
  5.  
  6. using namespace std;
  7.  
  8.  
  9. int main(){
  10.  
  11. string str2;
  12. cout << "Enter the contents of string 2";
  13. //cin >> str2;//Cin only takes in information until a blank space.
  14. getline(cin, str2);
  15. cout << str2;
  16.  
  17. string str3="Hello World";
  18. string str4="Hello World";
  19.  
  20. if (str3 == str4){
  21. cout << "They're equal!";
  22. }
  23. else {
  24. cout << "They're not equal";
  25. }
  26.  
  27. return 0;
  28. }
Success #stdin #stdout 0s 2860KB
stdin
Hello World How are you?
stdout
Enter the contents of string 2Hello World How are you?They're equal!