gpt4 book ai didi

c - 警告 : format ‘%d’ expects argument of type ‘int’ , 但参数 2 的类型为 ‘int *’

转载 作者:太空宇宙 更新时间:2023-11-04 08:32:55 25 4
gpt4 key购买 nike

<分区>

我很困惑为什么会抛出错误warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘int *’:

int x = 5;
int **y = &x;
printf("%d", y);

虽然这有效?

int x = 5;
int *y = &x;
printf("%d", *y);

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com