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
What are pragmas and what are they good for?
What does %p mean?
Can you add pointers together? Why would you?
Are the outer parentheses in return statements really optional?
What is the difference between a function and a method in c?
Is it possible to have a function as a parameter in another function?
What is the use of typedef in c?
find the output? void r(int a[],int c, int n) { if(c>n) { a[c]=a[c]+c; r(a,++c,n); r(a,++c,n); } } int main() { int i,a[5]={0}; r(a,0,5); for(i=0;i<5;i++) printf("\n %d",a[i]); getch(); }
Explain how can a program be made to print the name of a source file where an error occurs?
Tell me when is a void pointer used?
What is file in c preprocessor?
How the c program is executed?
In this problem you are to write a program that will cut some number of prime numbers from the list of prime numbers between 1 and N.Your program will read in a number N; determine the list of prime numbers between 1 and N; and print the C*2 prime numbers from the center of the list if there are an even number of prime numbers or (C*2)-1 prime numbers from the center of the list if there are an odd number of prime numbers in the list.
Can a pointer be null?
What is a global variable in c?