Possible Duplicate:
Difference between pointer variable and reference variable in C++
As I am starting with C++, I found the operation below confusing. I got to know about passing by reference and passing by value. But recently I came across functions like this which confused me:
Func1(int &a)
Func2(int *a)
Both of the functions expect the address of a, but when I call Func1 I do that by Func1(a)
and in case of Func2, I call by Func2(&a)
.
How come Func1 is accepting int a directly while it is expecting the address of a?