fork(2) download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4.  
  5. int main(void) {
  6. char *str = " teste";
  7. int j = 0;
  8. while (str[j] == ' ') j++;
  9. int size = strlen(str) - j + 1;
  10. char *result = malloc(size);
  11. memcpy(result, str + j, size);
  12. printf("%s", result);
  13. return 0;
  14. }
Success #stdin #stdout 0s 2292KB
stdin
Standard input is empty
stdout
teste