I’m implementing stack in C and I define pop function in C file:
int pop(int &x, int &y);
Xcode shows error (pointing on the first argument): Expected ‘)’
Any ideas why I have that problem? Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
C doesn’t have “pass by reference” like C++. To implement something like this, you need to use pointers:
…and somewhere else, in a function…
(It’s hard to know exactly what syntax details to give without knowing more about what the arguments are meant to be.)