Look directly at the code:
1#include <iostream>2 using namespacestd;3 intAddint*a,int*b) {4 ints;5s = *a + *b;6cout<<"SIG1"<<a<<endl;//a is a pointer, it is an address;7cout<<"Sig2"<<&a<<endl;//&a,& Here is still an access symbol, the address of the address is obtained;8cout<<"Sig3"<<*&a<<endl;//Here I think "*" is the address refers to the content presented, so here is a;9cout<<"SIG4"<<**&a<<endl;//, continue to read the contents of a as an address in memory;Ten returns; One } A intMain () { - intSum,a=1, b=2; -Sum=add (&a,&b);//Why use &a, here "&a" is the address, because the parameters of the add is a pointer, the pointer to point to the address; thecout<<"Sig5"<<&a<<endl;//It is also the one defined in line 13th, so it is the same as the 6th line; -cout<<sum<<endl;//Two values are added to return the value of the int type; - int*p=&A; -cout<<p<<endl;//assigns the address of a to the pointer p; +cout<<*p<<endl;//The content of the address pointed to by P; - int&c=a;//Here is the quote, read a blog post on a very good sentence "& is a reference after the type, and the variable is not next to the type is the address. " +cout<<c<<endl;//So here A is C, which is the same block in memory. A return 0; at}
Well, that's it. And so on follow-up, encountered problems to add.
C + + pointers, references, and values;