-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

混乱してごめんなさい。別のchar変数を追加して、それに値を設定するだけで自分で修正しました。lolz 時間を無駄にしてごめんなさい D:

于 2013-03-29T23:31:20.963 に答える