L
LBJ
I declare pointers as follows:
const int* pData; //pointer to read only data
int* const pData2; //read only pointer
Then I make the following assignment:
pData = pData2;
the read-only aspect of pData2 is not in any danger of being
corrupted by this assignment, and pData simply points to data that it
cannot modify. yet I am getting the following error on compilation:
warning: assignment discards qualifiers from pointer target type.
why would qualifiers be discarded?
const int* pData; //pointer to read only data
int* const pData2; //read only pointer
Then I make the following assignment:
pData = pData2;
the read-only aspect of pData2 is not in any danger of being
corrupted by this assignment, and pData simply points to data that it
cannot modify. yet I am getting the following error on compilation:
warning: assignment discards qualifiers from pointer target type.
why would qualifiers be discarded?