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
Why is sprintf unsafe?
How can I do graphics in c?
Discuss the function of conditional operator, size of operator and comma operator with examples.
What is the symbol indicated the c-preprocessor?
What is an auto keyword in c?
Can we use visual studio for c?
What is the basic structure of c?
Can you add pointers together? Why would you?
What is memory leak in c?
A function can make the value of a variable available to another by a) declaring the variable as global variable b) Passing the variable as a parameter to the second function c) Either of the two methods in (A) and (B) d) binary stream
What is the default value of local and global variables in c?
Explain what are the __date__ and __time__ preprocessor commands?
Write a c program to demonstrate character and string constants?
What is the difference between Printf(..) and sprint(...) ?
What are the difference between a free-standing and a hosted environment?