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

x=y=z=1 z=++x||++y&&++z Printf("%%%d";xyz) what is the values of x,y and z?????

3 Answers  


How do we declare variables in c?

0 Answers  


int main() { int *p=new int; *p=10; del p; cout<<*p; *p= 60; cout<<*p; } what will be the output & why?

4 Answers   TCS,


Device an algorithm for weiler-atherton polygon clipping, where the clipping window can be any specified polygon

0 Answers  


Is it better to use a macro or a function?

0 Answers  






who is the father of c

4 Answers   Infosys,


why effort estimation is important?

1 Answers  


Which node is more powerful and can handle local information processing or graphics processing?

0 Answers  


Combinations of fibanocci prime series

0 Answers  


What is the best way to store flag values in a program?

0 Answers  


What is the advantage of c?

0 Answers  


How can you call a function, given its name as a string?

0 Answers  


Categories