fork download
  1. #include <string>
  2. #include <iostream>
  3. #include <iomanip>
  4.  
  5. using namespace std;
  6.  
  7. int main() {
  8.  
  9. string command{"restoreauto"};
  10.  
  11. string test1{"restoreauto:ciap"};
  12.  
  13. cout << boolalpha << ( std::string{test1.c_str(), command.size()} == command) << endl;
  14.  
  15. return 0;
  16. }
Success #stdin #stdout 0s 5292KB
stdin
Standard input is empty
stdout
true