This is my first post so im unsure if this has been asked before.
Im trying to write a program that will update the size of an array while running. Say a count is given that will get larger and larger as information is entered, how do I reflect that in the size of the array, without putting in some rediculous number.



LinkBack URL
About LinkBacks



However, you didn't quite understand quzah's reply. He gave a link to the man pages for calloc, malloc, free, and realloc. Presumably the OP would read the page thoroughly and realize that realloc is the correct function to use, thus saving us the effort of explaining the gory details.