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

In a switch statement, explain what will happen if a break statement is omitted?

0 Answers  


what's the return value of malloc()

9 Answers  


What does static mean in c?

1 Answers  


How can I call a function with an argument list built up at run time?

0 Answers  


my name is nani i completed my b-tech in hyd now i want go for interveiw but i dont know the process of software field interveiws plz help me anyone how many rouds there n what rounds plz plz plz help me n where i can get these details

2 Answers  






Explain how can you tell whether a program was compiled using c versus c++?

0 Answers  


What is the difference between declaring a variable by constant keyword and #define ing that variable?

1 Answers  


How are structure passing and returning implemented?

0 Answers  


Find the second largest element in an array with minimum no of comparisons and give the minimum no of comparisons needed on an array of size N to do the same.

0 Answers   Amazon,


What is function what are the types of function?

0 Answers  


How can you return multiple values from a function?

0 Answers  


What is the scope of static variables?

1 Answers  


Categories