alright say i have a data file i want to open up and extract the data into a binary tree...
i do this to open the file:
binaryTree::information() {
ifstream file;
file.open ("proj4.dat");
}
although ill have more in that after i learn how to do it..
and i have this class with the struct in it:
#include <iostream>
#include <cstdlib>
#include <fstream>
using namespace std;
class binaryTree {
public:
binaryTree ();
~binaryTree ();
void menu ();
private:
struct info {
string employee;
string lastName;
string firstName;
char middleInitial;
string state;
string zipcode;
string department;
int yearsWorked;
int salary;
struct info * right;
struct info * left;
};
info * root;
void information (info &);
void insert (info *, info &);
void retrieveAll (info *);
void retrieveOpen (info *);
void retrieveCity (info *);
};
now the data file has the employee id, the first name, last name etc.
how do i get the info from the file into my program?
do i have to do like...
file.getline(something) = info.employee
what is the correct method for this?