Multi-dimensional Vectors
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?
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> >
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement