Top "Unsigned-char" questions

C - unsigned int to unsigned char array conversion

I have an unsigned int number (2 byte) and I want to convert it to unsigned char type. From my search, …

c byte unsigned-integer type-conversion unsigned-char
How to sprintf an unsigned char?

This doesn't work: unsigned char foo; foo = 0x123; sprintf("the unsigned value is:%c",foo); I get this error: cannot …

c++ printf unsigned-char
How to print unsigned char[] as HEX in C++?

I would like to print the following hashed data. How should I do it? unsigned char hashedChars[32]; SHA256((const unsigned …

c++ hex printf unsigned-char
Why can't I static_cast between char * and unsigned char *?

Apparently the compiler considers them to be unrelated types and hence reinterpret_cast is required. Why is this the rule?

c++ char reinterpret-cast static-cast unsigned-char
Copy unsigned char array

What would be the best way to copy unsigned char array to another? For example: unsigned char q[1000]; unsigned char …

c string strcpy unsigned-char
When is uint8_t ≠ unsigned char?

According to C and C++, CHAR_BIT >= 8. But whenever CHAR_BIT > 8, uint8_t can't even be represented as 8 …

c++ c types unsigned-char uint8t
Initializing an unsigned char array with hex values in C++

I would like to initialize an unsigned char array with 16 hex values. However, I don't seem to know how to …

c++ arrays hex unsigned-char
Casting from `int` to `unsigned char`

I am running the following C++ code on Coliru: #include <iostream> #include <string> int main() { int …

c++ casting unsigned-char
Invalid conversion from unsigned char* to char*

Here is a code - 1 int main(int argc, char *argv[]) 2 { 3 signed char S, *psc; 4 unsigned char U, *pusc; 5 char …

c++ char signed unsigned-char
How do I #define an unsigned char* string?

I have following define in my code #define PRODUCTNAME "SomeName" and I want to send it with a function com_…

c c-preprocessor unsigned-char signedness