what is the difference between
const char *p, char const *p, const char* const p

Answer Posted / bhargav

Const char *P ->
declares a pointer through which you may be able to access
a char but you can not change it through the said pointer.
But the pointer itself can be changed.

char const *p ->
in this the value is constant

const char* const p ->
both address and value are constants

Is This Answer Correct ?    13 Yes 22 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is function prototype?

601


Why is c so popular?

634


Can static variables be declared in a header file?

606


Explain goto?

703


Why shouldn’t I start variable names with underscores?

611






Was 2000 a leap year?

614


How do you determine whether to use a stream function or a low-level function?

631


How are variables declared in c?

584


How are 16- and 32-bit numbers stored?

703


How can I remove the leading spaces from a string?

623


What is the use of a static variable in c?

578


Can you please explain the difference between exit() and _exit() function?

576


Explain high-order bytes.

660


write a program to print the consecutive repeated character from the given string... input string is : hhhhjkutskkkkkggggj output should be like this: hhhhkkkkkgggg anyone help me...

1476


What is static memory allocation?

595