Can't print u8

Post Reply
BlyZe
Posts: 6
Joined: Mon Sep 09, 2024 7:04 am

Can't print u8

Post by BlyZe » Tue Sep 10, 2024 11:27 am

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

WinterMute
Site Admin
Posts: 1980
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: Can't print u8

Post by WinterMute » Sat Oct 12, 2024 11:45 pm

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

Help keep devkitPro toolchains free, Donate today

Personal Blog

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests