0

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]; 

2 Answers 2

3

Try:

Gluint *indices = malloc(count * sizeof(Gluint));
Sign up to request clarification or add additional context in comments.

Comments

0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.