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

What is the use of a ‘’ character?

593


What is the difference between scanf and fscanf?

677


What is static volatile in c?

584


How do you define CONSTANT in C?

663


Is it acceptable to declare/define a variable in a c header?

693






write a c program for swapping two strings using pointer

2102


What is a structure in c language. how to initialise a structure in c?

617


When can you use a pointer with a function?

578


What are header files in c?

627


How do you sort filenames in a directory?

723


Where in memory are my variables stored?

643


Can we change the value of static variable in c?

570


Is c procedural or functional?

595


What is use of integral promotions in c?

673


Explain the use of fflush() function?

631