fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. typedef char * pchar;
  5.  
  6. void balabol(pchar * volatile result) {
  7. pchar text = "Сорок тысяч обезьян в жопу сунули банан.";
  8. size_t len = strlen(text) + 1;
  9. *result = malloc(len);
  10. memmove(*result, text, len);
  11. }
  12.  
  13. int main() {
  14. pchar buffer = NULL;
  15. printf("Pointer before call: %p\n", buffer);
  16. balabol(&buffer);
  17. printf("Pointer after call: %p\n", buffer);
  18. printf("%s\n", buffer);
  19. free(buffer);
  20. return 0;
  21. }
  22.  
Success #stdin #stdout 0s 5524KB
stdin
Standard input is empty
stdout
Pointer before call: (nil)
Pointer after call: 0x563095856270
Сорок тысяч обезьян в жопу сунули банан.