Another problem that i'm running in to
Hmmm...I must have missed the first one.
1)
Code:
#include <iostream.h>
#include <conio.h> //get rid of this
#include <stdlib.h> //get rid of this
#include <fstream.h>
should be:
Code:
#include <iostream>
#include <fstream>
and change this:
to:
2)should be:
3) Don't use eof() as the means to terminate reading from the file. That can cause problems with infinite loops; it is not as straightforward as it appears. Instead, to properly terminate loops that read from files, you should use your read statement as the while loop conditional, e.g.:
Code:
while( in_file>>structure[i].title>>structure[i].author>>structure[i].pages )
4)
Another problem that i'm running in to is that everytime i run the program, it creates the file, i don't want this to happen.
Huh? open() fails if it can't find the file. Where is the program creating a file?