不能在Stroustrup的PPP2e章找到3错误7钻
问题描述:
我无法找到的第三个错误Stroustrup的http://www.stroustrup.com/Programming/calculator08buggy.cpp不能在Stroustrup的PPP2e章找到3错误7钻
到目前为止,我已经在结构令牌添加了这个让代码编译:
Token(char ch, string s) :kind(ch), name(s) { }
而且在Token_stream ::让我改变
while(cin.get(ch) && (isalpha(ch) || isdigit(ch))) s=ch;
到:
while(cin.get(ch) && (isalpha(ch) || isdigit(ch))) s+=ch;
这:
if (s == "quit") return Token(name);
到:
if (s == "quit") return Token(quit);
,但我找不到过去的错误。我似乎无法得到代码打破,并重新阅读代码几次后,我无法找到更多的错误。
答
for (int i = ...
//签署对无符号comparsion(使用的size_t代替)
i <= names.size()
//它会后线上最后一个有效后来
而且也未使用的变量访问元素139
令牌:: get(),double get_value(std :: string)和double primary():至少有一条路径没有返回...
只是想知道,但需要多长时间才能找到这些错误?我想我需要更多的经验/练习 – London
我已经使用了大部分这些墙壁。而“ KIIV
好的非常感谢您的帮助! – London