Jump to content
  • Advertisement
Sign in to follow this  
lonewolf2852

Multi-dimensional Vectors

This topic is 3969 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, I am currently working on a problem where I have to accept input as pairs of numbers until I receive a final pair of 0 0. i.e. n m n m n m n m 0 0 I was thinking, since I need to make the program without any assumptions as to how many pairs there are, if there was any way I could make a 2dimensional array? How would I go about doing that?

Share this post


Link to post
Share on other sites
Advertisement
It doesn't sound like you need a two-dimensional vector. It sounds like you need a vector of pairs. Ex: std::vector<std::pair<int, int> >

Share this post


Link to post
Share on other sites
Quote:
Original post by SiCrane
It doesn't sound like you need a two-dimensional vector. It sounds like you need a vector of pairs. Ex: std::vector<std::pair<int, int> >


I didn't know they existed... Thank you very much! :D

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!