Which operator is used to access the memory address of a variable in C++?
- * (Asterisk)
- & (Ampersand)
- % (Percent)
- + (Plus)
The "&" (ampersand) operator is used to get the memory address of a variable in C++. For instance, if int x = 10;, then &x will give the memory address where the integer x is stored. The asterisk (*), on the other hand, is used for dereferencing.
Loading...
Related Quiz
- Which function is used to get the position of the file pointer in a file?
- In C++, the return statement cannot be used inside a _______.
- The goto statement can only jump to labels within the same _______.
- In C++11 and later, the keyword _______ can be used in a range-based for loop to avoid copying elements.
- In a situation where multiple if conditions are true, the _______ block will be executed in C++.