Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我很难调试这小段代码。我得到的错误是:'错误:'='令牌之前的预期主表达式。有人可以指出我正确的方向吗?谢谢。
for(int i = 1+a.size(); i> =1; i=i+2) // should be i>=1; { out_stream_dob << a[i] << endl; }
看到 和 之间的空间了>吗=?你不想要那个空间:
>
=
for (int i = a.size() - 1; i >= 1; i = i - 2) // Also mind your initialization and step! { out_stream_dob << a[i] << endl; }
您的运算符> =位于中间表达式中,因此它被解析为两个单独的运算符。应该是>=。
> =
>=