fork(4) download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main(void) {
  5. char buffer[] = "Hello";
  6. size_t size = strlen(buffer);
  7. for(int i = 0; i < size / 2; i++) {
  8. char tmp = buffer[i]; //armazena o character inicial
  9. buffer[i] = buffer[size - i - 1]; //Troca o character da ponta oposta
  10. buffer[size - i - 1] = tmp; //Armazena o character inicial no buffer
  11. }
  12. printf("%s", buffer);
  13. return 0;
  14. }
  15.  
Success #stdin #stdout 0s 2112KB
stdin
Standard input is empty
stdout
olleH