Joke Collection Website - Mood Talk - In C++, what's the difference between quoting and taking an address?
In C++, what's the difference between quoting and taking an address?
1. Reference: used to pass values.
2. Address extraction: used to extract the first address.
Second, the operation is different.
1. reference: Addressing a reference means addressing the target variable. & ampRa and&; A equals. That is to say, the reference name is an alias of the target variable name.
2. Address fetch: the operation of returning a pointer, the value of which is the address opened when P was declared at that time, and the type of the pointer is the pointer type corresponding to the type of P. ..
Third, the characteristics are different.
1. reference: after the reference declaration is completed, it means that the target variable name has two names, namely the original name of the target and the reference name, and the reference name can no longer be used as an alias for other variable names.
2. Address: Use&; When an operator accepts an address, it can be compiled without any coercion.
Baidu encyclopedia-&
Baidu Encyclopedia -C++ citation
- Previous article:Tell me about your online dating. Did I disappoint you?
- Next article:It means the future is beautiful, so tell me what it is.
- Related articles
- A granddaughter in Zhanjiang, Guangdong Province took her grandfather to buy roast chicken. How do you feel when you see this scene?
- Seeing the person you like, you are always excited, flustered, introverted and shy.
- 202 1 is a very popular inspirational quote: those who succeed early may not succeed, and those who succeed late may not fail.
- Review your failed weight loss experience.
- Are there any pictures about girlhood?
- Friends circle greetings suitable for cold weather are very cold, but friendship does not cool down.
- On Ma Zi Poetry (Ma Zi Poetry)
- The best friend wants a hard happy word.
- Does LAM Raymond Tieqi have a winch?
- 55 things you can do when you are alone.