Skip to main content
GameDev.net gamedev.net
🔒 Locked

problem with array type

Started by pressgreen Jul 27, 2011 at 12:19 AM 2 replies 1.6k views
Original Post
pressgreen
pressgreen
I get an error when i am trying to make a float array with c++. any ideas of what could be the problem?

[color="#008000"] int** ippArray = new int*[3];
for(int i = 0; i < 3; ++i)
{
ippArray = new int[3];
}
works

[color="#FF0000"]float** ippArray = new float*[3];
for(float i = 0; i < 3; ++i)
{
ippArray = new float[3];
}
does not work
J-GREEN

Greenpanoply
zerothrillz
zerothrillz

I get an error when i am trying to make a float array with c++. any ideas of what could be the problem?

[color="#008000"] int** ippArray = new int*[3];
for(int i = 0; i < 3; ++i)
{
ippArray = new int[3];
}
works

[color="#FF0000"]float** ippArray = new float*[3];
for(float i = 0; i < 3; ++i)
{
ippArray = new float[3];
}
does not work



Why are you using floating point type for your array index variable? That would be the first thing I'd try changing.
ApochPiQ
ApochPiQ
Please do not ask questions by just saying "it doesn't work."

At least be kind enough to tell us what the error is. Otherwise, we have to sit around and play guesswork and 20-questions to get at the real problem.
pressgreen
pressgreen
sorry about not placing more info. i did figure out the issue i was having and i would close this so no one would have to read through it any longer but i don't know how. also thanks for your guy's time and sorry again if i wasted yours. was not intentional.
J-GREEN

Greenpanoply

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.