constant pointer vs pointer on a constant value

<>

This question already has an answer here:

Answers


char * const a;

means that the pointer is constant and immutable but the pointed data is not. You could use const_cast(in C++) or c-style cast to cast away the constness in this case as data itself is not constant.

const char * a;

means that the pointed data cannot be written to using the pointer a. Using a const_cast(C++) or c-style cast to cast away the constness in this case causes Undefined Behavior.


Need Your Help

How to know when ImageView finishes loading the image?

java android imageview loading

I have an Activity which loads a custom ImageView ( https://github.com/MikeOrtiz/TouchImageView/blob/master/src/com/example/touch/TouchImageView.java). Inside onCreate, I use setImageBitmap to disp...