Hi!
I'm trying to write a program that has a struct of dvd info that I have written below. I then have a text file that reads into a array (dvdArray) I then need to figure out a way to read the dvdArray into the dvd stuct and then print it out. I'm not sure how to separate the information in dvdArray and then read it into the different parts of the dvd struct
That's true, here's the format of the text file:
Mean girls; comedy; PG; 2009; Regina George; 12.07.2015;
The Conjuring; Horror; R; 2013; Sara Johnson; 16.05.2016;
Pokemon 2000; Kids; G; 2000; Ash Katchem; 15.04.2016;
etc...
Okay so I did what you said and it kind of worked.
It print out like this:
Title: PG
Genre: 2013
Rating: Steven Rogers
Release date: 15.04.2016
Name of renter:
Date rented: Action
So it's not organized properly and that's not the first line of text. in the file, it's actually the last. I think it's cause I'm not using a array which is what I would prefer to do.
So what I would like to do is have read the text file into the Array and from there read the Array into the struct. So instead of the text file reading into the vector I need it to read into the array and from there read the first line of the array (dvdArray[1]) into struct dvd and then print out that information using print function and then loop that until dvdArray[10] is read into struct dvd!