Objective C 中的整数数组
我尝试创建一个如下所示的数组:
count = [corners count];
Gluint indices [count];
我使用了计数值,它工作正常,但在创建索引数组时,该值不存在。好像有
indices [-1]
我该怎么办?根据角点的数据,count的值是不同的。我不能使用下面的代码:
Gluint indices [24];
I try to create an array like below:
count = [corners count];
Gluint indices [count];
i used the count value and it works fine but when creating array of indices the value is not there. It seems to have
indices [-1]
what should i do? the value of count is different based on the data of corners. I cannot used this code below:
Gluint indices [24];
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试:
Try:
您还可以使用 NSMutableData,然后获得诸如引用计数之类的东西(如果这对您有用的话),它还可以更轻松地更改大小。
You can also use NSMutableData you then get things like reference counting if that is useful to you, it also makes it easier to change the size.