gpt4 book ai didi

c - 当我运行这个时,编译器说 :the assignment makes integer from a pointer without a cast

转载 作者:行者123 更新时间:2023-11-30 21:39:06 25 4
gpt4 key购买 nike

int age[3];
printf("what is your age?\n");

scanf("%d\n",age);

int age[3]

age[3] =age+1;

int year[3];

year[3] = year+1;

printf("your age after %d years is %d",age,year);

最佳答案

首先,我不明白你想要做什么。但 int 数组无法通过 scanf("%d\n",age);

扫描

你必须:

for(i=0;i<3;i++)
scanf("%d",&age[i]);

关于c - 当我运行这个时,编译器说 :the assignment makes integer from a pointer without a cast,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40593531/

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