C++读txt档,我是用一个字一个字的读,当我读到句子中的某一字时,想退到前一个字,请问有没有办法?取字的方法为file.get(ch);while () {lexbuf[b] = t;file.get(ch);t = ch;b = b + 1;}像是这样的code在某一function

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/02 08:29:23
C++读txt档,我是用一个字一个字的读,当我读到句子中的某一字时,想退到前一个字,请问有没有办法?取字的方法为file.get(ch);while () {lexbuf[b] = t;file.get(ch);t = ch;b = b + 1;}像是这样的code在某一function

C++读txt档,我是用一个字一个字的读,当我读到句子中的某一字时,想退到前一个字,请问有没有办法?取字的方法为file.get(ch);while () {lexbuf[b] = t;file.get(ch);t = ch;b = b + 1;}像是这样的code在某一function
C++读txt档,我是用一个字一个字的读,当我读到句子中的某一字时,想退到前一个字,请问有没有办法?
取字的方法为file.get(ch);
while () {
lexbuf[b] = t;
file.get(ch);
t = ch;
b = b + 1;
}
像是这样的code在某一function中,最後会return这一整个token,但是有读超过的时候,不知有没有什麼内建可以退到前一个字读

C++读txt档,我是用一个字一个字的读,当我读到句子中的某一字时,想退到前一个字,请问有没有办法?取字的方法为file.get(ch);while () {lexbuf[b] = t;file.get(ch);t = ch;b = b + 1;}像是这样的code在某一function
unget