fork(2) download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4.  
  5. int main(void)
  6. {
  7. char str[] = "how are you";
  8. char *p = NULL;
  9.  
  10. while ((p = strrchr(str, ' ')) != NULL)
  11. {
  12. printf ("%s ", (p + 1));
  13. *p = '\0';
  14. }
  15.  
  16. printf ("%s\n", str);
  17.  
  18. return 0;
  19. }
  20.  
Success #stdin #stdout 0.02s 2724KB
stdin
Standard input is empty
stdout
you are how