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(
std::string
fgets()
char*
fgets(
Pass it in through the constructor:
const char* dat = "my string!"; std::string my_string( dat );
You can use the function string.c_str() to go the other way:
std::string my_string("testing!"); const char* dat = my_string.c_str();