Need more efficient way to append character arrays
Hey my character array stores a list of items but my implementaion is very inefficient. Here is what I do:
1. I Create a buffer of 100 chars.
2. My function search for the items in a text file.
3. If the list goes over 100 chars then i create new char * and move all the list to the new one.
Quote:
3. If the list goes over 100 chars then i create new char * and move all the list to the new one.
step 3 is my problem because I'm creating a new buffer for the whole list everytime when the list needs more space.
Is it possible to append the new buffer to the old list, instead of creating a new buffer for the whole list?
Thanx in advance
PS: I can't use linked list because I need to pass the items back to client app.