Reading file into array of struct??

Hi everyone. I have a homework assignment where I must create an array of a stucture consisting of a float member and a integer member with room for 10 elements. The program should open a .txt file and read in the following numberical values from that file(values listed below). Below is what I have so far. Please tell me if it is correct, and also how do I read the values from the .txt into the array?? Thanks in advance.

values in .txt file:
10 7.35
-21 45.9
3 -4.56
85 34.1
-9 -32.7


#include <iostream>
#include <fstream>
#include <istream>
using namespace std;

struct info //declaring my data stucture
{
int member1; //declaring a variables within the data stucture
float member2;

}entry[10]; //declaring an array of the data structure with space for 10 elements


int main ()
{

ifstream myfile;
myfile.open("CSC2144N.txt");




system("pause");


Topic archived. No new replies allowed.