const char *
char * const
What is the differnce between the above tow?.
Answers were Sorted based on User's Feedback
Answer / bava
in the first case it is pointer to a constant (i.e the
address can be changed ,where as the content/value in that
address cannot be changed).
In the later case it is a constant pointer (i.e the address
cannot be changed ,where as the content/value in that
address can be changed).
| Is This Answer Correct ? | 10 Yes | 1 No |
Answer / kamaljit singh
in the first case it is pointer to a constant (i.e the
address can be changed ,where as the content/value in that
address cannot be changed).
In the later case it is a constant pointer (i.e the address
cannot be changed ,where as the content/value in that
address can be changed).
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / vignesh1988i
as for as i know.....
1) const char * :
here the character pointer is a constant which can point to
oly one character type memory location throught the program.
2) char * const :
hrere the pointer is not a constant , the character variable
used after it will be constant.. in that variable we cant
make any changes... but in pointer we can make
thank you
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / lokesh143
In first case address is constant
later case value is constant
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / subbu
answer is opposite to above answer
first case is constant pointer means that the address which
is assigned at the time of decalaration can not be changed
yet.
in the second case it is pointer to a constant, means the
value stored at that particular address cannot be changed
| Is This Answer Correct ? | 1 Yes | 2 No |
What is integer constants?
Did c have any year 2000 problems?
How to calculate Total working time using Login and logout?
2 Answers CTS, Cygnus, Infosys, Signal Networks, TCS, Wipro,
which operator having lowest precedence?? a.)+ b.)++ c.)= d.)%
What is the difference between functions abs() and fabs()?
regarding the scope of the varibles;identify the incorrect statement: a.automatic variables are automatically initialised to 0 b.static variables are are automatically initialised to 0 c.the address of a register variable is not accessiable d.static variables cannot be initialised with any expression
implement general tree using link list
What are the string functions? List some string functions available in c.
how to write a prog in c to convert decimal number into binary by using recursen function,
A text file that contains declarations used by a group of functions,programs,or users a) executable file b) header file c) obj file d) .cfile
Explain what is wrong with this statement? Myname = ?robin?;
How to define structures? ·