what is diffrence between string and character array?

Answer Posted / vadivelt

By default String always ends with NULL character ie., '\0'.

But in character array manually it is needed to terminate
with NULL(You can do this, only when you wanted to use
character array as string)

Eg;

char *p = "Vadivel"; /*By default string is terminated
with '\0'*/

char array[8] = {'V','a','d','i','v','e','l','\0'};
/*Here terminated manually*/

Is This Answer Correct ?    9 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain how can I manipulate strings of multibyte characters?

773


What is #define in c?

608


Explain high-order bytes.

670


What are the rules for identifiers in c?

579


What are the types of data types and explain?

662






What is quick sort in c?

577


How do you construct an increment statement or decrement statement in C?

732


i want to know the procedure of qualcomm for getting a job through offcampus

1923


What is the difference between int main and void main?

567


Explain is it valid to address one element beyond the end of an array?

724


Differentiate between new and malloc(), delete and free() ?

662


Why is c known as a mother language?

738


What is static and auto variables in c?

552


in ‘C’ language for Matrix Multiplication fails” Introspect the causes for its failure and write down the possible reasons for its failure.

7385


What is the difference between array_name and &array_name?

768