
October 28th, 2009, 11:53 AM
|
|
Registered User
|
|
Join Date: Oct 2009
Posts: 53
Time spent in forums: 7 h 26 m 22 sec
Reputation Power: 0
|
|
|
Not able to understand Compiler error
#include<stdio.h>
void swap(int& a,int& b)
{
int temp;
temp=a;
a=b;
b=temp;
}
void main()
{
int i=9,j=10;
swap (i,j);
printf (" i is %d",i);
printf (" j is %d",j);
}
Gives following compiler error
Error 1 error C2143: syntax error : missing ')' before '&'
Error 2 error C2143: syntax error : missing '{' before '&'
I am not able why compiler is complaining
|