1

I'm doing the Stanford xcode class CS193P assignment #2 and I'm getting some errors. The tasks is to write a calculator program with variables. I am using Xcode 3.2.6 www.stanford.edu/class/.../Assignment%202_1.pdf

I'm getting the error Expected expression before '@' token when I am declaring vp

#define VARIABLE_PREFIX @“%”


- (void)setVariableAsOperand:(NSString *)variableName
{
    NSString *vp = VARIABLE_PREFIX; (error is on this line) 
    NSString *variable = [vp stringByAppendingString:variableName];
    [self addObjectToExpression:variable];  
}

Does anyone know how to fix this problem? Message me if you have any questions. Thanks for your help!

1 Answers1

-1

Quotes in C++ have to be of the right kind, i.e. " (U+0022, QUOTATION MARK). Some applications (read: not proper text editors) will convert typed quotes into ‘fancy’ ones, e.g. (U+201C, LEFT DOUBLE QUOTATION MARK) and (U+201D, RIGHT DOUBLE QUOTATION MARK).

Watch out for copying code via a word processor, e-mail composer, etc. And if you need to examine a character your text editor of choice might be able to do it (I know Emacs can), or you can use tools like this one.

Biffen
  • 6,249
  • 6
  • 28
  • 36