fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. void allocate(unsigned char** t)
  5. {
  6. int m;
  7. *t=(unsigned char*)malloc(3*sizeof(unsigned char));
  8. if(*t == NULL)
  9. printf("Allcoation failed\n");
  10. else
  11. for(m=0;m<3;m++)
  12. (*t)[m]='a';
  13. }
  14.  
  15. int main()
  16. {
  17. unsigned char* t;
  18. allocate(&t);
  19. printf("%c %c\n", t[0], t[1]);
  20. return 0;
  21. }
  22.  
Success #stdin #stdout 0s 2380KB
stdin
Standard input is empty
stdout
a a