I am unable to get "reference to a pointer".
Here:
Code:
char*p = "hello";
char*&k = p;
while creating reference to a pointer why we have to write *&k , why not &*k?
I recommend you:
Change your code writing style to use spaces like
Code:
char* p = "hello";
char*& k = p;
Use Code tags while posting code snippets.
Now about your question:
Code:
char a; // character a
char* p; // p is a pointer to a character
char& r; // r is a reference to a character
char*& rp; // r is a reference to a pointer to a character
char&* pr; // r would be a pointer to a reference to a character
When we run the above program compiler error :"left operand must be l-value" occur , why it's telling about left operand while in the
program 3 is on RHS... ????
1. Return to the list of threads in C++ (Non Visual C++ Issues) forum.
2. Access the Post New Thread page through the button-like link.
Originally Posted by Tanushreeagr
When we run the above program compiler error :"left operand must be l-value" occur , why it's telling about left operand while in the
program 3 is on RHS... ????
You are mistaken: 3 is on the left hand side.
C + C++ Compiler: MinGW port of GCC
Build + Version Control System: SCons + Bazaar
Bookmarks