wats the diference btwen constant pointer and pointer to a
constant.pls give examples.

Answer Posted / rani

Constant pointer cannot be reassigned to different objects
once its initialized. It can be used to modify the object
that it points to.

Eg.
int *const constPtr;

*constPtr =0; //can be modified like this

Pointer to constant can be reassigned to point to another
object of same type.

int const *ptrConst;

ptrConst = 0;

Is This Answer Correct ?    37 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we replace the struct function in tree syntax with a union?

782


What is pass by value in c?

597


formula to convert 2500mmh2o into m3/hr

498


Can the size of an array be declared at runtime?

610


What is sizeof array?

613






can anyone suggest some site name..where i can get some good data structure puzzles???

1643


What are the application of c?

650


What is sizeof int?

637


Explain what is gets() function?

633


Explain b+ tree?

629


What are keywords in c with examples?

604


What is c value paradox explain?

576


Can a variable be both static and volatile in c?

608


What is the difference between the = symbol and == symbol?

629


What is the difference between fread buffer() and fwrite buffer()?

674