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 the difference between local variable and global variable in c?
How can I open files mentioned on the command line, and parse option flags?
How will you delete a node in DLL?
What is a stream?
What is dynamic dispatch in c++?
Write programs for String Reversal & Palindrome check
stripos — Find position of first occurrence of a case- insensitive string int stripos ( char* haystack, char* needle, int offset ) Returns the numeric position of the first occurrence of needle in the haystack string. Note that the needle may be a string of one or more characters. If needle is not found, stripos() will return -1. The function should not make use of any C library function calls.
What is a macro, and explain how do you use it?
Explain Basic concepts of C language?
What is pointer to pointer in c?
What would be an example of a structure analogous to structure c?
The postoder traversal is 7,14,3,55,22,5,17 Then ur Inorder traversal is??? please help me on this
Why do we use return in c?
How can I pad a string to a known length?
What is a scope resolution operator in c?