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


Please Help Members By Posting Answers For Below Questions

What is the size of empty structure in c?

579


What do you mean by scope of a variable in c?

530


stripos — Find position of first occurrence of a case- insensitive string int stripos ( char* haystack, char* needle, int offset ) Returns the numeric position of the first occurrence of needle in the haystack string. Note that the needle may be a string of one or more characters. If needle is not found, stripos() will return -1. The function should not make use of any C library function calls.

1834


What is LINKED LIST? How can you access the last element in a linked list?

618


What are the 4 types of functions?

559






What are lookup tables in c?

536


What are structure members?

584


please help me..... please codes and flowchart plz turbo c lang po yan.....please asap response... 3. Make an astrology program. The user types in his or her birthday (month, day, and year as integer), and the program responds with the user’s zodiac sign, horoscope, and other information related to it. If the user’s birth year falls into a leap year, your program should display an appropriate message for it. NOTES: Conditional Statements: it should be with graphics

2846


Is c procedural or object oriented?

561


Discuss the function of conditional operator, size of operator and comma operator with examples.

664


What tq means in chat?

569


What is pointer & why it is used?

585


What was noalias and what ever happened to it?

576


Explain how can you check to see whether a symbol is defined?

644


What is auto keyword in c?

778