I was messing around with the memset function and did this:
int* p = malloc(sizeof(int);
memset(p, 0, 10000);
I was wondering why this is valid. I've only allocated 5 bytes of memory yet I can take up 10000 with memset. Why should I even malloc the memory if I can take up more than allocated? Could someone explain?