fork download
  1. #include <iostream>
  2. #include <string>
  3. #include <cstdio>
  4.  
  5. int main()
  6. {
  7. std::string text = "0/41/9/71.94 PC:0x82cc (add)";
  8.  
  9.  
  10. std::string opcode(5, '\0'); // Some suitable maximum size
  11. sscanf(text.c_str(), "%*[^(](%[^)]", &opcode[0]);
  12.  
  13. std::cout << opcode;
  14. }
  15.  
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
add