This is really useless without telling us what errors.
You want to populate an array like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#include<iostream>
#include<utility>
#include<vector>
int main()
{
std::vector<std::pair<int, int> > ar;
int a(0);
int b(0);
for (int i = 0; i < 5; i++)
{
std::cin >> a >> b;
ar.push_back(std::make_pair(a, b));
}
return 0;
}
IMHO, you shouldn't try too hard; it is mere syntactic sugar.
If, in your experience, search and replace makes maintenance easier, stay with search and replace.
yea i know, but i think often it slows me down when i'm trying to understand other people's code. But i am fairly dumb.
Sorry for hijacking the thread OP.