fork download
  1. #include <iostream>
  2. #include <cstring>
  3.  
  4. using namespace std;
  5.  
  6. void reverseStr(char* ch) {
  7.  
  8. if(ch==NULL) return;
  9.  
  10. reverseStr( strtok( NULL , " " ) );
  11. cout << ch << " ";
  12. }
  13.  
  14. int main() {
  15.  
  16. char str[] = "how are you";
  17. reverseStr( strtok( str , " " ) );
  18.  
  19. return 0;
  20. }
Success #stdin #stdout 0.01s 2680KB
stdin
Standard input is empty
stdout
you are how