Questions tagged [dynamic]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
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". ...