You have a hex representation of a character in a string, and you want the character?
easiest:
unsigned char c;
istringstream str(at);
str >> hex >> c; // force the stream to read in as hex
vect.push_back(c);
(I think that should work, have not tested it)
I just reread your question again, this line:
I have an unsigned char* c that
contains the element 0x1c
Does this mean that actually your unsigned char* looks like this:
unsigned char c[] = {0x1c}; // i.e. contains 1 byte at position 0 with the value 0x1c?
or my assumption above...
to print the vector out to cout, use a simple for loop, or if you are feeling brave
std::cout << std::ios_base::hex;
std::copy(vect.begin(), vect.end(), std::ostream_iterator<unsigned char>(std::cout, " "));
std::cout << std::endl;
this will print the hex representations of each of the unsigned char values in the vector separated by a space.
vect[1] = *c? I haven't used C++ in a while though.vect[0]rather thanvect[1]if you want to set the first value. Also, what error are you actually getting?