I am running Code::Blocks 10.05 on Mac OS X 10.6.8
void swap(int& a, int& b)
{
int aux;
printf("\nValues at entry: a=%d b=%d\n", a, b); aux=a; a=b; b=aux;
printf("\nValues at exit: a=%d b=%d\n", a, b);
}
void main()
{
int a, b;
a=2; b=3;
printf("\nIn the main function, prior to invoking swap: a=%d b=%d\n", a, b);
swap(a, b);
printf("\nIn the main function, after the return from swap: a=%d b=%d\n", a, b);
}
in compilation, it appears the following error:
error expected : "," , "," or ")" before token "&"
I have coppied the source from a book.