Advertisement
ahmed4star

test malloc

May 25th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.21 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3.  
  4. void f(void);
  5.  
  6. int main(void)
  7. {
  8.   f();
  9. }
  10.  
  11. void f(void)
  12. {
  13.   int *x = malloc(10 * sizeof(int));
  14.   x[10] = 50;
  15.   printf("malloced %i\n",x[10]);
  16.   //  free(x);
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement