Questions tagged [realloc]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
123 views

realloc and length in load(), server.c

I need help with load() in server.c. This is a follow-up to the other question, except now I'll post the updated code and make it a bit more specific. When I tested the server after implemented ...
2
votes
2answers
1k views

What will realloc() do if the contiguous memory location is already occupied?

Consider- char* name1 = malloc(4 * sizeof(char)); name1 = "Mike"; Now if i want to put "Mike Smith" in the same string "name1", I need 6 more bytes of memory (one for the space and 5 for "Smith". ...