My question is exactly the same as this one. That is, I\'m trying to use scanf()
to receive a string of indeterminate length, and I want scanf()
to dyn
Standard versions of scanf()
do not allocate memory for any of the variables it reads into.
If you've been hoodwinked into using a non-standard extension in some version of scanf()
, you've just had your first lesson in how to write portable code - do not use non-standard extensions. You can nuance that to say "Do not use extensions that are not available on all the platforms of interest to you", but realize that the set of platforms may change over time.