fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. void hoge(char *str)
  5. {
  6. char *p;
  7.  
  8. p = strchr(str, '\n');
  9. if (p == NULL) return;
  10. memmove(str, p, strlen(p) + 1);
  11. }
  12.  
  13. int main()
  14. {
  15. char str[] = "abc\ndef";
  16.  
  17. hoge(str);
  18. printf("%s\n", str);
  19. return 0;
  20. }
  21.  
Success #stdin #stdout 0.02s 1676KB
stdin
Standard input is empty
stdout
def