fork download
  1. #include <iostream>
  2. #include <cstring>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7. using std::strstr;
  8. char buffer[120000] = "<context>abc</context>";
  9. char *pc1;
  10. char *pc2;
  11.  
  12. pc1 = strstr(buffer, "<context>");
  13. pc2 = strstr(buffer, "</context>");
  14.  
  15. while(pc1<=pc2)
  16. cout << pc1++;
  17. return 0;
  18. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
<context>abc</context>context>abc</context>ontext>abc</context>ntext>abc</context>text>abc</context>ext>abc</context>xt>abc</context>t>abc</context>>abc</context>abc</context>bc</context>c</context></context>