initialize an array

Started by
5 comments, last by majc 18 years, 8 months ago
How i initialize an array like this: sRoute Route[5] = { {400.0f,pLand->GetHeight(Enemy->sngPositionX, Enemy->sngPositionZ),100.0f}, {100.0f,pLand->GetHeight(Enemy->sngPositionX, Enemy->sngPositionZ),300.0f}, {300.0f,pLand->GetHeight(Enemy->sngPositionX, Enemy->sngPositionZ),200.0f}, {200.0f,pLand->GetHeight(Enemy->sngPositionX, Enemy->sngPositionZ),100.0f}, {0.0f,pLand->GetHeight(Enemy->sngPositionX, Enemy->sngPositionZ),400.0f} }; Thanks in advance!!
Do you want to know how to make games?
http://howtomakeagam...n.blogspot.com/
Advertisement
That is initialised, although im not entirely sure about the function call in the middle. Is it not compiling?

ace
Its compiling but give me a memory error.
I tryed Route = new sRoute[5];
but i didnt have any luck.
Thanks!
Do you want to know how to make games?
http://howtomakeagam...n.blogspot.com/
The first thing you should try whenever you get something like this is taking out that function call and replace it with a number, just to see if that is the problem. The pointer might be NULL.

ace
That is not the problem.
But thanks anyway.
Do you want to know how to make games?
http://howtomakeagam...n.blogspot.com/
You can definately remove the 5 with no problems.

ace
I already fix it.
Thanks!
Do you want to know how to make games?
http://howtomakeagam...n.blogspot.com/

This topic is closed to new replies.

Advertisement