Hello I was wondering if someone could give me a good example how to use realloc with strings in standard C, not C++.
I am reading lines from a file char by char. And would like to make an empty char string called row. Then when I read a new character I would like to add that character at the end of that string and reallocated the memory. Since I don't know how long the strings are I can't just make char row[10]; Also when I reach new row I would like to empty this string. Could someone give me a good example how to make this. Not the reading part I have that, just the string appending part. Thank you.