Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdlib.h>
- #include <stdio.h>
- #include <crtdbg.h>
- typedef struct{
- int* b;
- }gangster;
- gangster initG();
- int main( )
- {
- gangster G = initG();
- G.b[0] =2;
- printf("%d\n",G.b[0]);
- free(G.b);
- _CrtDumpMemoryLeaks();
- }
- gangster initG(){
- gangster x;
- x.b = (int*) calloc(5,sizeof(int));
- return x;
- }
Add Comment
Please, Sign In to add comment