6 ms·
Actually, since st1 is a char* and the sizeof char is 1, that is a valid declaration. It just probably isn't doing what the writer expects. It allocates 5000 by
by scdlbx 16y ago
Actually, since st1 is a char* and the sizeof char is 1, that is a valid declaration. It just probably isn't doing what the writer expects. It allocates 5000 bytes and then moves the pointer to point at the very last byte.
edit: Though free()ing it would not work so well until you move the pointer back to the beginning of the 5000 bytes.
- azim 16y agoI think that's what the writer expected. On x86 the stack starts at a high address and grows downward to a lower address.