const char *
char * const
What is the differnce between the above tow?.

Answers were Sorted based on User's Feedback



const char * char * const What is the differnce between the above tow?. ..

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

const char * char * const What is the differnce between the above tow?. ..

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

const char * char * const What is the differnce between the above tow?. ..

Answer / satish

declaration of pointer after character in the first
case,but in second case before constant declaring the
pointer

Is This Answer Correct ?    3 Yes 2 No

const char * char * const What is the differnce between the above tow?. ..

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

const char * char * const What is the differnce between the above tow?. ..

Answer / lokesh143

In first case address is constant
later case value is constant

Is This Answer Correct ?    0 Yes 0 No

const char * char * const What is the differnce between the above tow?. ..

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

Post New Answer

More C Interview Questions

Write the program with at least two functions to solve the following problem. The members of the board of a small university are considering voting for a pay increase for their 10 faculty members. They are considering a pay increase of 8%. Write a program that will prompt for and accept the current salary for each of the faculty members, then calculate and display their individual pay increases. At the end of the program, print the total faculty payroll before and after the pay increase, and the total pay increase involved.

0 Answers   Convergys,


main() {int i=5; // line 1 i=(++i)/(i++); // line 2 printf("%d",i); // line 3 } output is 2 but if we replace line 2 and line 3 by printf("%d",i=(++i)/(i++)); then output is 1. Why?

1 Answers   GATE,


what's the return value of malloc()

9 Answers  


What is signed and unsigned?

0 Answers  


Explain following declaration int *P(void); and int (*p)(char *a);

3 Answers  






What is enumerated data type in c?

0 Answers  


What is double pointer?

0 Answers  


how to find that no is int or float?

5 Answers  


What is the use of a semicolon (;) at the end of every program statement?

1 Answers  


What is the use of getchar functions?

0 Answers  


What are the different types of data structures in c?

0 Answers  


What is memmove?

1 Answers   Oracle,


Categories