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

Here is a good puzzle: how do you write a program which produces its own source code as output?

587


Is a house a shell structure?

686


What do you mean by a sequential access file?

617


What are identifiers in c?

621


differentiate built-in functions and user – defined functions.

607






What is sizeof c?

593


in any language the sound structure of that language depends on its a) character set, input/output function, its control structures b) character set, library functions, input/output functions its control structures c) character set, library functions, control sturctures d) character set, operators, its control structures

668


What are comments and how do you insert it in a C program?

730


Describe static function with its usage?

597


What are data types in c language?

577


while loop contains parts a) initialisation, evalution of an expression,increment /decrement b) initialisation, increment/decrement c) condition evalution d) none of the above

723


what are enumerations in C

714


Explain what are the advantages and disadvantages of a heap?

589


What does %p mean c?

613


What is the purpose of main( ) in c language?

606