What is the difference between constant pointer and pointer
to a constant. Give examples.
Answer Posted / prashant
the example given by Santosh for "Constant Pointer" is wrong .
Use
int * const p = &localVariable;
instead of const int *p = &localVariable;.
then we cant do p++ or p--;
| Is This Answer Correct ? | 5 Yes | 1 No |
Post New Answer View All Answers
What is pointer to pointer in c language?
An expression to whose value an operater is applied a) operand b) variable c) constant d) all of the above
Write a program to find the biggest number of three numbers in c?
Explain what happens if you free a pointer twice?
illustrate the use of address operator and dereferencing operator with the help of a program guys plzzz help for this question
Is it possible to use curly brackets ({}) to enclose single line code in c program?
A c program to display count values from 0 to 100 and flash each digit for a secong.reset the counter after it reaches 100.use for loop,. pls guys hepl me.. :(
Explain about block scope in c?
What is the modulus operator?
Can you subtract pointers from each other? Why would you?
How are portions of a program disabled in demo versions?
What is the best style for code layout in c?
`write a program to display the recomended action depends on a color of trafic light using nested if statments
What is the use of static variable in c?
Explain what is the difference between a free-standing and a hosted environment?