Page 1 of 1

Can't print u8

Posted: Tue Sep 10, 2024 11:27 am
by BlyZe

When I print an u8 value the numbers are between 100 and 1000 for some reason.

My code:

Code: Select all

typedef struct color
{
	u8 R;
	u8 G;
	u8 B;
} color_rgb;

Code: Select all

	color_rgb color;
	color.R = 255;
	color.G = 255;
	color.B = 255;
	color.R++;
	printf("\x1b[7;2H\x1b[31m%u\x1b[0m", color.R);

Re: Can't print u8

Posted: Sat Oct 12, 2024 11:45 pm
by WinterMute

This code prints a red 0 as I'd expect. There must be more context to your issue.