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

What are the __date__ and __time__ preprocessor commands?

0 Answers  


What is volatile c?

0 Answers  


Explain the properties of union. What is the size of a union variable

0 Answers  


what is the importance of spanning tree?

0 Answers  


Give a method to count the number of ones in a 32 bit number?

4 Answers  






What is conio h in c?

0 Answers  


Where does the name "C" come from, anyway?

0 Answers   Celstream,


second highest number in a given set of numbers

3 Answers   TCS,


What does %c do in c?

0 Answers  


What are the types of assignment statements?

0 Answers  


How to removing white spces in c programming only bu using loops

2 Answers  


What does a function declared as pascal do differently?

0 Answers  


Categories