Advertisement
lukhavi

ReverseTypeC

Sep 25th, 2020
1,513
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. void imprimeReves(const char*);
  6.  
  7.  
  8. int main(void){
  9.  
  10. const char *s = "Hola Mundo";
  11.  
  12. imprimeReves(s);
  13.  
  14. return 0;
  15.  
  16. }
  17.  
  18. void imprimeReves(const char *pszCadena){
  19.  
  20. int i;
  21.         for(i=0;pszCadena[i];i++);
  22.  
  23.         while(--i>=0)
  24.                 cout<<pszCadena[i];
  25.        
  26.         cout<<endl;
  27. }
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement