fork download
  1. #include <iostream>
  2. #include <string>
  3. #include <algorithm>
  4. #include <vector>
  5. #include <string.h>
  6.  
  7. using namespace std;
  8.  
  9. void func(string * str)
  10. {
  11. reverse(str->begin(), str->end());
  12. }
  13.  
  14. int main(void)
  15. {
  16. string str("pop'n candy!");
  17. cout << str << endl;
  18. func( &str );
  19. cout << str << endl;
  20.  
  21. return 0;
  22. }
  23.  
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
pop'n candy!
!ydnac n'pop