differentiate between
const char *a;
char *const a; and
char const *a;
Answer Posted / vignesh1988i
const char *a : means the string is constant and the pointer
is not...
const char *a="HELLO WORLD" , if we take this example for
the whole scope of the program the string is constant and we
can't assign any other string to that pointer 'a'....
char * const a : means the pointer is constant (address) but
string is not......
char * const a="hello world" , if we take this example ,
here the address will be always constant.... string can vary..
char const *a : means string is a constant and pointer is
not..... as we have seen from the first example...
thank u
| Is This Answer Correct ? | 37 Yes | 2 No |
Post New Answer View All Answers
What is the difference between struct and typedef struct in c?
How can a program be made to print the line number where an error occurs?
What are enums in c?
Can stdout be forced to print somewhere other than the screen?
What is the difference between text and binary modes?
What are the types of arrays in c?
How many loops are there in c?
Place the #include statement must be written in the program?
Why main function is special give two reasons?
What are local static variables? How can you use them?
difference between native and cross compilers
what are the program that using a two dimensional array that list the odd numbers and even numbers separately in a given 10 inputs values
What are the two types of structure?
What is anagram in c?
What is indirection? How many levels of pointers can you have?