Answered step by step
Verified Expert Solution
Question
1 Approved Answer
My program needs to read into a lines.txt that says 0 a a b c 0 b b e f 1 c c h i
My program needs to read into a lines.txt that says
0 a a b c 0 b b e f 1 c c h i 2 d d k l
and then output a table like
0:a b c |b e f |- - - |- - - | 1:- - - |- - - |c h i |- - - | 2:- - - |- - - |- - - |d k l |
I am currently just on a function for reading the lines.txt file and putting the data into vectors. I am stuck on how to set a b c, b e f, c h i, d k l into the vector T[row][col].
The function will also not run unless I return a value, but I am unsure at the moment what I should return.
// this reads the input file into the matrix table lint readTable() { int row, col; char col_c; ifstream fin("lines.txt", ios::in); // Read in the file into I while (fin >> row) // per row { fin >> col_c; col = convert(col_c); // to a slot number vector
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started