Guest User

Untitled

a guest
May 23rd, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3. #include <crtdbg.h>
  4.  
  5. typedef struct{
  6. int* b;
  7. }gangster;
  8.  
  9. gangster initG();
  10. int main( )
  11. {
  12. gangster G = initG();
  13. G.b[0] =2;
  14. printf("%d\n",G.b[0]);
  15. free(G.b);
  16. _CrtDumpMemoryLeaks();
  17. }
  18.  
  19. gangster initG(){
  20. gangster x;
  21. x.b = (int*) calloc(5,sizeof(int));
  22. return x;
  23. }
Add Comment
Please, Sign In to add comment