So what I'm trying to do is read data from a file, to then edit specific portions of it. Two types of people will be viewing it (the "employee" and "the manager"). The "employee" can only edit the first 5 words, while the "manager" can edit anything.
The problem I am having is after I get it into an array, either all of the info in one line gets put in without spaces in between them, making it so I can't call the line to edit it. Or there are too many spaces added (after several views) where it crashes the program (also, still cannot read the line from the array to edit it).
newfile.open("Ndatabase.txt");
if(newfile.fail()){
cerr<<"File not found"<<endl;
exit(1);
}
oldfile.open("database.txt");
if(oldfile.fail()){
cerr<<"File not found"<<endl;
exit(1);
}
/*************************************************************************/
/*************************************************************************/
//Everything above this point is good, opening, reading, and putting data into temp file.
//Everything below is what I was trying to work with to edit. I was trying to put the
//info into an array so we can search for a line, then output what information they would
//be allowed to change. I have it going into the array, but if you want spaces to actually
//read the file it eventually crashes the program becasue of too much space, along with the
//fact it doesn't read the input to compare to the line. While the other way where it doesn't crash
//puts no spaces between each word in the line, but seperates the line. However, because there are
//no spaces, the program cannot read the line.
//This text just puts the info into an array and back to the original file, I don't see
//any way to change info from here, but I kept it in case I need to start from scratch.