what is the difference between char * const and const char
*?
Answer Posted / brindha
Char* const p -> Here pointer P is a const pointer, which
means that this pointer can point to only one memory
location. eg. char* const p = &arr;
p++ ; -> This is invalid
const char* p -> this indicates that the data pointed by
the pointer p is constant & the value in that address
cannot be modified. eg. const char* p = 'a';
*p = 'b'; -> This is invalid
| Is This Answer Correct ? | 30 Yes | 2 No |
Post New Answer View All Answers
Can a program have two main functions?
Is fortran faster than c?
What is pointer & why it is used?
What is the use of gets and puts?
What are the main characteristics of c language describe the structure of ac program?
Can we compile a program without main() function?
Tell me when would you use a pointer to a function?
what are the advanced features of functions a) function declaration and prototypes b) calling functions by value or by reference c) recursion d) all the above
Why we write conio h in c?
Explain what is the difference between #include and #include 'file' ?
Explain what are global variables and explain how do you declare them?
When do we get logical errors?
What is .obj file in c?
What is c language used for?
When should the const modifier be used?