Data pairs in array

Hi, I don't know how to store input data pairs into an array. I have to insert two text files into the program prompting the user to input the file names (I have done this bit). Now I need store input data pairs into an array. The task is basically to create a wave on c++ using 2 files which both contain 361 pairs of numbers, the first number of the pair is time and the second one is the corresponding amplitude at that time, I also have to use 3 different classes. Anyone have any ideas how to do this?
http://www.cplusplus.com/reference/utility/pair/

You don't indicate the types of numbers in the pair, so I'm going to assume two doubles although the types in std::pair can be any type.

1
2
3
4
5
6
7
8
9
10
#include <utility>
using namespace std;

const int MAXSIZE = 361;
pair<double,double> pairs[MAXSIZE];

int main ()
{   pairs[0] = make_pair (1.0, 2.0);
    return 0;
}

Last edited on
Topic archived. No new replies allowed.