Login
Roast topics
Find topics
Find it!
From:
Stack Overflow
(Uncensored)
subscribe
c - Negative indexing; gives error upon freeing - Stack Overflow
https://stackoverflow.com/questions/14795001/negative-indexing-gives-error-upon-freeing
links
backlinks
Roast topics
Find topics
Roast it!
In C, I encountered an error when I coded the following example: int *pointer; int i = 0; pointer = malloc(10 * sizeof(int)); pointer[i - 1] = 4; Clearly i is a negative index into pointer. Even...