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

Answer Posted / magdaleen

In a const char *p the chrac pointed by 'p' is a const, so
u cant change the value of the charac ponted by 'p', but u
can make 'p' refer to some other location.

In a char const *p, the ptr 'p' is constant not the
character refered by it, so u can not make 'p' refer to
anyother location, but u can change the value of the charac
pointed by 'p'

Is This Answer Correct ?    10 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is wild pointer in c with example?

570


What are derived data types in c?

606


which is conditional construct a) if statement b) switch statement c) while/for d) goto

735


What is hashing in c?

638


Write a program that takes a 5 digit number and calculates 2 power that number and prints it(should not use big integers and exponential functions)

5790






a) Identify the following declarations. Ex. int i (integer variable) float a[l0](array of 10 real nos) int (*f())() void *f int (*f()) [] void *f int f[] [] [] char *(*f) () int (*f[]) [] float(*f) [] [] float **f int ******f

1585


Explain built-in function?

587


Where are c variables stored in memory?

592


praagnovation

1774


What is extern keyword in c?

639


What is the scope of static variable in c?

531


What is the use of function overloading in C?

675


When should you not use a type cast?

655


Why should I use standard library functions instead of writing my own?

668


How can you access memory located at a certain address?

663