Is this correct:
a) Pointer p1 to a char:
char* p1;
b) A constant pointer p2 to a char:
char* const p2;
c) pointer p3 to a constant char:
const char* p3;
d) A constant pointer p4 to a constant char:
const char* const p4;
e) A reference r1 to a char:
char & r1;
f) A reference r2 to a constant char:
const char& r2;
Would you please notify me any mistakes?
A pointer is a variable that stores the address of another variable. Unlike other variables that hold values of a certain type, pointer holds the address of a variable. For example, an integer variable holds (or you can say stores) an integer value, however an integer pointer holds the address of a integer variable.
A pointer is a variable that stores the memory address of another variable as its value.
They are all correct. I can't see any mistakes :-)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With