ok my getData() function reads a text file and stores it into an array called info, and everytime it reads a letter from that file it calls a member called addRear which comes from my link list class "slist". what i need help on is how could i display this information using my Printdata function and display in on the screen on a readable format like below, please any help. Also my link list class has a member called displayAll which displays all the elements on the link list
lets say the my text file looks something like this
A 2 B C
B 1 D
C 1 A
D 2 C A
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include "slist.h"
#include "ll.C"
using namespace std;
void getData();
void printData();
const int SIZE = 10;
struct info
{
char vertexName;
int outDegree;
slist adjacentOnes; // this comes from slist.h which is a link list class
};
int main()
{
}
//PURPOSE: GETS DATA FROM THE FILE
void getData()
{
ifstream fin("table.txt"); // opens the file
string line; // declares line as a string
// goes on a for loop and reads every variable, if variable is
// a letter it calls addRear and appends it to the back of a list
for(int i = 0; i<SIZE && getline(fin, line); i++)
{
istringstream S(line);
S >> table[i].vertexName >> table[i].outDegree;
char x;
while(S >> x)
table[i].adjacentOnes.addRear(x);
}
}
}
void printData()
{
}