This is the problem:
int num = -16;
int div = num / sizeof(int);
The value of div is incorrect (Some big garbage value). But if I do,
int num = -16;
int intSize = sizeof(int);
int div = num / intSize;
Then it gives the correct answer. What I need to know is, why does this happen?