-2

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

4

1 回答 1

-1

sorry bout the confusion. i fixed it myself by just adding another char variable, and then setting value to that. lolz sorry for wasting your time D:

于 2013-03-29T23:31:20.963 回答