wats the diference btwen constant pointer and pointer to a
constant.pls give examples.
Answer Posted / rudra prasad panda
Pointer is a variable containing the addres of another
variable;
Constant pointer is a variable which points to a variable
constantly.it means that , once it is initialised,it cannot
be changed.Till the end of program,it points to that
variable only;
EXAMPLE:
char k,m;
const char *p=&k;
p=&m;//(syntax error)
********
A pointer to a constant is a pointer such that the contents
of the variable(pointed by the pointer)cannot be modified
throuhg the pointer;
EXAMPLE:
char m='l';
char * const p;
p=&m;
*p='u';//syntax error
m='k';//no syntax error
| Is This Answer Correct ? | 8 Yes | 42 No |
Post New Answer View All Answers
a character or group of characters that defines a register,or a part of storage a) memory b) byte c) address d) linear list
Write a C++ program to generate 10 integer numbers between - 1000 and 1000, then store the summation of the odd positive numbers in variable call it sum_pos, then find the maximum digit in this variable regardless of its digits length.
Where does the name "C" come from, anyway?
What are the different types of linkage exist in c?
What is const and volatile in c?
How can you find out how much memory is available?
List some basic data types in c?
which type of aspect you want from the student.
Explain which of the following operators is incorrect and why? ( >=, <=, <>, ==)
Can you return null in c?
What is extern storage class in c?
Where is c used?
What is the scope of global variable in c?
What is adt in c programming?
Explain setjmp()?