Quote:
I just wanted to know/try whether is it possible without malloc/realloc.
Is it possible that you don't store at all and you first input 'entire string'
and then print entire string. (No storage could be required..)
|
If you input anything, you need to store it someplace in RAM. That is why you need to malloc/realloc the memory. In answer to your question, no it is not possible to input anything without preallocating a memory buffer to hold it. Storage in this case is RAM.