if anyone is familiar with steve summit's c tutorial (http://c-faq.com/~scs/cclass/) thats what im reading
anyway
it says in section 11.3 (beginner's tutorial) that i can use realloc like so:
newpointer_to_int = realloc(oldpointer_to_int,maxsize*sizeof(int));
the compiler (dev-cpp) gives an error:
[Warning] assignment makes pointer from integer without a cast
it wont let me assign the pointer realloc returns? to a new pointer
supposedly im supposed to be assigning this new pointer to see if it would be null or not so i know whether or not to try to write to the newly reallocated memory
but if i dont bother with that, if i just assume the rellocation works it compiles fine
ie:
realloc(oldpointer_to_int,maxsize*sizeof(int));
anyone want to enlighten me? perhaps re-explain how realloc actually works and maybe comment on the tutorial and tell me if its wrong or if im screwing up or what
one last thing, lcc gives me even more errors than dev-cpp lol so im just using dev-cpp