what is diffrence between string and character array?



what is diffrence between string and character array?..

Answer / 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

More C Interview Questions

Difference between fopen() and open()?

3 Answers   Aricent,


What is use of integral promotions in c?

0 Answers  


What is conio h in c?

0 Answers  


i have to apply for rbi before that i need to know the the syllabus for the entrance questions. whethet it may be aps or techinical

0 Answers  


Is there any data type in c with variable size?

0 Answers  


Are negative numbers true in c?

0 Answers  


What is spaghetti programming?

0 Answers  


How many levels of indirection in pointers can you have in a single declaration?

0 Answers   Agilent, ZS Associates,


write a program that explain #define and # undef directive

1 Answers  


Can u return two values using return keyword? If yes, how? If no, why?

7 Answers  


An array name contains base address of the array. Can we change the base address of the array?

4 Answers   NMIMS, Wipro,


What are dangling pointers? How are dangling pointers different from memory leaks?

1 Answers  


Categories