converting const char to string isn't working

71 Views Asked by At

Trying to convert type const char to type std::string. All the examples I've seen are for const char *. If I change my type to * the dc.at will fail.

The conversion to string is failing. I've been trawling for an hour, it can't be that hard, I'm clearly missing something simple.

std::string dc = "fdsda4w4bfd*4t4vwrsv";
const char dcchar = dc.at(11);
std::string ms_char = dcchar;

enter image description here

std::string ms_char(dchar); also fails

0

There are 0 best solutions below