If the array was null-terminated this would be pretty straight forward:
unsigned char u_array[4] = { \'a\', \'s\', \'d\', \'\\0\' }; std::string str
You can use this std::string constructor:
std::string
string ( const char * s, size_t n );
so in your example:
std::string str(u_array, 4);