Dynamic allocation with scanf()

后端 未结 5 1956
孤街浪徒
孤街浪徒 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:27

    Must you absolutely use scanf ? Aren't std::string s; std::cin >> s; or getline( std::cin, s ); an option for you?

提交回复
热议问题