Sign in to follow this  
lonewolf2852

Multi-dimensional Vectors

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this