using realloc for expand string | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

using realloc for expand string

how to expand string without memory leak using realloc()?

18th Jan 2020, 4:51 PM
Yaroslaw
Yaroslaw - avatar
2 Answers
0
char *string = malloc(...); /* ... */ string = realloc(...); this code will not delete my string? if realloc() return false?
18th Jan 2020, 5:51 PM
Yaroslaw
Yaroslaw - avatar
0
thank you Coder Kitten
18th Jan 2020, 6:08 PM
Yaroslaw
Yaroslaw - avatar