convert a char* to std::string

后端 未结 11 1018
萌比男神i
萌比男神i 2020-12-02 04:08

I need to use an std::string to store data retrieved by fgets(). To do this I need to convert the char* return value from fgets(

11条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-02 04:42

    I need to use std::string to store data retrieved by fgets().

    Why using fgets() when you are programming C++? Why not std::getline()?

提交回复
热议问题