read lenght of string from stdin
- by teoz
I want to take a string from stdin but I don't want a static array of fixed size
i knew that scanf need something where save the stdin input, but i can't do something like this:
char string[10]
scanf("%s",string);
becouse i need to knew before how long will be the string in order to allocate the right memory space
can you help me to resolve this problem?