Learn Courses My Dashboard

Crazy xcode errors

I’ve got an xcode project in C and I’m getting errors on statements that are obviously correct.
For example:

void dup() { // S(x) ==> S(x x)
uint16 x = pop();
push(x); push(x);

gives this error: “Expected ; after struct”

But it’s not a struct, it’s a function definition!

uint16 is defined as “unsigned short” and works fine in other places,so that’s not a problem.

Any help greatly appreciated!


Welcome to the Code Crew community.

dup looks like it may be a reserved word so try naming the function differently.

Yes, that was ther problem – thanks!