pointer 102 question

Posted on 16th Feb 2014 by admin

I read a book
1
2
3
4
5
6
7
8
9
10
11
12
int main() { int i; f(&i); cout << i; return 0; void f(int *j) { *j = 100; } }

I don't understand why f(&i) will work
&i is the address of i
should void f(int *j) change to void f(int &j)?
I understand I must be wrong, but what the meaning difference fot those two expressions??

Other forums