im using this sort of code and i keep getting "segmentation error"
do
{
file.getline(book, LARGEST, '\n') ;
for (int i = 0; i <= 24; i++)
{
a[Read].author[i] = book[Count] ;
Count++ ;
}
for (int i = 0; i <= 30; i++)
{...
I'm using the above method, with a for loop to read in each different variable.
However what its doing is displaying the files wrong, so when i store the tit variable, it some how affects the author variable.
I'm gonna continue playing, maybe try some form of while loop too.
OK new problem, as im trying to move this data to seperate variables, the "author" works but the title, category, and number dont.
i was going to use "for loops", is there a better way of doing this cos this is totally stumping me!
Thanks guys
Hi guys.
I'm rying to read in from a text file. The text file is formatted like this:
author ;title ;category;number
(there are 28 lines)
How can i read this data into 4 user defines variables, using an array? i am using this code:
BookData a[MAX] ;
int Read = 0 ;
do
{...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.