Multi-dimensional Vectors

Started by
1 comment, last by lonewolf2852 16 years, 2 months ago
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?
---Veni, Vidi, Vici.War is Peace. Freedom is Slavery. Ignorance is strength.
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> >
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
---Veni, Vidi, Vici.War is Peace. Freedom is Slavery. Ignorance is strength.

This topic is closed to new replies.

Advertisement