i'm doing a project, and i need to set 3 variables for each time reading a character from a document. here's what i have so far:
while(instream.get(value)){
value = convertToUpper(value);
cout << value;
oldestval = oldval;
oldval = value;
}
where oldval
, oldestval
, and value
are all char
. instream
is my instance of ifstream
and convertToUpper()
just makes the char uppercase. so if you can't tell, i need oldval
to equal what value
was, and then set value. the problem i have is that i HAVE to have it in this loop, because this loop reads the whole file to the end. my question is, from what you have seen, how would i fix my problem? i can provide the whole program if it helps. let me know and thanks for the help! thanks :D