3 ms·
The code fragment Box **myBoxes = malloc(10*sizeof(Box)); Box *myBox = malloc(sizeof(Box)); myBoxes[0] = myBox; looks like it should have used 10
by tromp 9y ago
The code fragment
Box **myBoxes = malloc(10*sizeof(Box));
Box *myBox = malloc(sizeof(Box));
myBoxes[0] = myBox;
looks like it should have used 10 times the size of a Box pointer.
- nymph019283 9y agoThank you for that catch!