I have a C code like below:
char* text;
get(text); //or
scanf("%s",text);
But I try to run this it breaks. Because I did not give size for text
.
Why I did not give a size for text
, because i don't know what is the size of
text that user is going to enter.
So, what can i do, in situations like this?
How can I read the text if I don't know the length of string?