Storing value of unsigned int variable in char array in C [closed]

You can use sprintf for this:

char str[50];
sprintf(str, "(%d, %d, %d, %d)", r1, r2, r3, r4);

Now the string str contains the string (255, 204, 0, 255).

Leave a Comment