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)
.
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)
.