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
Study the following C program :call_me (myvar)int myvar;{ myvar +- 5; }main(){int myvar;myvar = 3;call_me(myvar);printf("%d ",myvar);What will be printed a) 3 b) 5 c) 8 d) symbol
What language is windows 1.0 written?
What is sizeof in c?
Explain what happens if you free a pointer twice?
What are the types of unary operators?
Write a program to identify if a given binary tree is balanced or not.
What are the types of assignment statements?
What are the preprocessor categories?
What is dangling pointer in c?
What is pivot in c?
what is the c source code for the below output? 5555555555 4444 4444 333 333 22 22 1 1 22 22 333 333 4444 4444 5555555555
How do you determine a file’s attributes?
What is variable and explain rules to declare variable in c?
c language supports bitwise operations, why a) 'c' language is system oriented b) 'c' language is problem oriented c) 'c' language is middle level language d) all the above
can any one tel me wt is the question pattern for NIC exam