Thanks again. I read that people have had trouble with recursive functions in macros. I'm not sure what the benefit is except for maybe simple computations.
So I took your suggestion, and I wrote the following code:
Code:
#include <stdio.h>
#include <stdlib.h>
#define SUMARRAY(x,y) \
int main(void)
{
int x[3] = {1, 2, 3};
int total;
total = SUMARRAY(x,3);
printf("%d", total);
system("pause");
return 0;
}
The problem is that I get 12 errors after I compile the code, and it starts with the same one "c_13.10.c(13) : error C2059: syntax error : 'while'". The question I have is that the first error points to line 13. Why is that?