Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Frank Henry

Problems with Arrays in Visual Studio7.net

This topic is 5995 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi all. i seem to be having problems with arrays:
  
float doink[16];

for (int i = 0; i < 4; i++)
  for (int x = 0; x < 4; x++)
    doink [i][x] = i*x;
  
i get a error about ''doink [x]''. am i forgetting something? do i have to set a flag or something? thank frank

Share this post


Link to post
Share on other sites
Advertisement
These two types are different:
    
float doink[16];
float doink[4][4];

You're trying to treat them the same. Hence the error.



Edited by - Stoffel on February 21, 2002 4:16:55 PM

Share this post


Link to post
Share on other sites
Yeah, it was pointer arithmetic. You can use doink[i * x] if you want to use 2 variables to access the array. . .

Edited by - acw83 on February 21, 2002 8:26:12 PM

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!