I tried to initialized const char pointer to pointer variable. Following is the way i did it.but once i run the program it thows an error(Pops up "encountered an problem and needs to close... Tell microsoft about this problem...")

const char * FB="test";
const char **Feedback ;
Feedback = &FB;

How can I intialize a value for const char pointer to pointer variable

8 Years
Discussion Span
Last Post by Salem

Are you saying that just those 3 lines (and nothing else) cause a problem?

Or do you then go on to do something with Feedback which actually causes the crash?
A small complete program which crashes is much more useful for us to tell you where you went wrong.

It should be
char * const * Feedback = &FB;


Hi salem,

as u said problem might not in those three lines. becoz i m passing that FeedBack value to a function

MyClass obj;
obj.setvalue(FeeedBack); // here Feed Back is of type const char** FeedBack.


Hi all,

Its working fine if I pass it as a char ** FeedBack not as Const char ** Feedback.
seems to b we cant pass const values like this way???


Like I said, if you don't post exactly what you're trying to do (like how you implement the function you're calling, and why the use of const is important).

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.