convert unsigned char* to std::string

std::string sName(reinterpret_cast<char*>(name));

reinterpret_cast<char*>(name) casts from unsigned char* to char* in an unsafe way but that’s the one which should be used here. Then you call the ordinary constructor of std::string.

You could also do it C-style (not recommended):

std::string sName((char*) name);

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)