Quote Originally Posted by ekhule View Post
Why does it not print out the entire unsgined char* ?
You are dereferencing the pointer, so the type going to cout is unsigned char, not unsigned char*.

If you don't dereference, then cout will probably print the address held by the pointer rather than the string as you want. I'm not positive though. This is because C usually stores strings in signed char arrays rather than unsigned, so the compiler may not have the "special case" logic in place which tells it to treat unsigned char*s as NULL-terminated strings. If you cast the unsigned char* to char*, it should work.

Of course, the simplest thing to do would be to avoid C-style strings entirely and use a vector<string> instead.