【发布时间】:2014-05-24 18:44:17
【问题描述】:
我正在做斯坦福 xcode 类 CS193P 作业 #2,但遇到了一些错误。任务是编写一个带有变量的计算器程序。我正在使用 Xcode 3.2.6 www.stanford.edu/class/.../Assignment%202_1.pdf
我在声明 vp 时收到错误 Expected expression before '@' token
#define VARIABLE_PREFIX @“%”
- (void)setVariableAsOperand:(NSString *)variableName
{
NSString *vp = VARIABLE_PREFIX; (error is on this line)
NSString *variable = [vp stringByAppendingString:variableName];
[self addObjectToExpression:variable];
}
有谁知道如何解决这个问题?如果您有任何问题,请给我留言。谢谢你的帮助!
【问题讨论】:
-
这是您的代码的逐字副本吗?那些引号看起来是错误的。
-
确定这是c++代码?!?
-
@Biffen 是的,那是逐字记录。我刚刚删除了引号并现在重新输入它们,它解决了我的问题。谢谢!我想知道我是怎么得到错误的报价的
标签: c++ xcode variables calculator cs193p