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


Please Help Members By Posting Answers For Below Questions

When we use void main and int main?

673


List out few of the applications that make use of Multilinked Structures?

1482


c program to compute AREA under integral

1931


Which is not valid in C a) class aClass{public:int x;}; b) /* A comment */ c) char x=12;

711


What are the advantages of c language?

763






What are the main characteristics of c language describe the structure of ac program?

744


When should I declare a function?

725


What is the difference between struct and typedef struct in c?

755


What are the output(s) for the following ? #include char *f() {char *s=malloc(8); strcpy(s,"goodbye")} main() { char *f(); printf("%c",*f()='A'); }

799


What is property type c?

710


Write a program of advanced Fibonacci series.

797


How is a null pointer different from a dangling pointer?

661


1) There is a singing competition for children going to be conducted at a local club. Parents have been asked to arrive at least an hour before and register their children’s names with the Program Manager. Whenever a participant registers, the Program Manager has to position the name of the person in a list in alphabet order. Write a program to help the Program Manager do this by placing the name in the right place each time the Program Manger enters a name. 2) the Event Manager has to send participants to the stage to perform in the order in which they registered. Write a program that will help the Event Manager know who to call to the stage to perform. The Logic should be in Data Structures

2849


How many loops are there in c?

684


shorting algorithmS

1892