fork(2) download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. void changeBuff(unsigned char ** b)
  5. {
  6. (*b)[0] = 0x12;
  7. (*b)[1] = 0x34;
  8. }
  9.  
  10. int main(void) {
  11. unsigned char * buf = (unsigned char *)malloc(sizeof(unsigned char) * 2);
  12. buf[0] = 0x55;
  13. buf[1] = 0xAA;
  14. printf("%x\t%x\n", buf[0], buf[1]);
  15. changeBuff(&buf);
  16. printf("%x\t%x\n", buf[0], buf[1]);
  17. return 0;
  18. }
  19.  
Success #stdin #stdout 0s 10304KB
stdin
Standard input is empty
stdout
55	aa
12	34