gpt4 book ai didi

iphone - 出现 'Assignment makes integer from pointer without cast' 错误

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

我似乎无法弄明白。这是它遇到问题的行之一:

hourToReadOut = currentHourInt - 12;

hoursToReadOutcurrentHoursInt 都是 .h 文件中的整数。 currentHourInt 总是设置为某物。

最佳答案

当您将指针分配给整数时会出现此错误:

int *intPtr;
int intVar;
intVar = intPtr - 12;

看起来 currentHourInt 是一个指针,而不是一个整数,你确定不是吗?

关于iphone - 出现 'Assignment makes integer from pointer without cast' 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4761456/

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