Dynamic allocation with scanf()

后端 未结 5 1951
孤街浪徒
孤街浪徒 2021-01-25 06:58

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

5条回答
  •  说谎
    说谎 (楼主)
    2021-01-25 07:24

    Don't use scanf for reading strings. It probably doesn't even do what you think it does; %s reads only up until the next whitespace.

提交回复
热议问题