I wonder why when I try to declare the array using #define I get errors from compiler, while using literal instead of the size allows me to do so.
some_name.h:
#define size 10;
int* waitingBench[size];
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.
Remove the
;from your definition. As you currently have it, this is equivillent toint* waitingBench[10;];which you know is incorrect.Macro definitions are not C instructions, so they do not need to be terminated with a semi-colon (and they must not exceed one line unless a line continuation backslash is used, and they must not share the line with something else).