From 06aa4eba30aea1c9e88f109064f04cadd6e2d5db Mon Sep 17 00:00:00 2001 From: chengjun8888 Date: Tue, 26 Nov 2024 03:18:44 +0000 Subject: [PATCH] =?UTF-8?q?sizeof=20=E8=BF=90=E7=AE=97=E7=AC=A6=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E7=9A=84=20size=5Ft=20=E7=B1=BB=E5=9E=8B=E7=9A=84?= =?UTF-8?q?=E5=80=BC=E6=98=AF=E6=97=A0=E7=AC=A6=E5=8F=B7=E6=95=B4=E6=95=B0?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=EF=BC=8C=E6=A0=BC=E5=BC=8F=E5=8C=96=E8=BE=93?= =?UTF-8?q?=E5=87=BA=E5=BA=94=E4=BD=BF=E7=94=A8%zu=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chengjun8888 --- playground/oexp/see/code/ch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playground/oexp/see/code/ch.c b/playground/oexp/see/code/ch.c index 26b2901..0cf41a4 100644 --- a/playground/oexp/see/code/ch.c +++ b/playground/oexp/see/code/ch.c @@ -23,7 +23,7 @@ int main() { // two's complement of -1: 1111 1111b char ch = -1; - printf("sizeof ch is %d, %d, %d, %d\n\n", sizeof(char), sizeof(ch), sizeof(signed char), sizeof(unsigned char)); + printf("sizeof ch is %zu, %zu, %zu, %zu\n\n", sizeof(char), sizeof(ch), sizeof(signed char), sizeof(unsigned char)); printf(" char ch = %2xh, %+4d, ", ch & 0xff, ch); PNP(ch); printf("\n\n"); printf(" signed char ch = %2xh, %+4d, ", (signed char)ch & 0xff, (signed char)ch); PNP((signed char)ch); printf("\n"); -- Gitee