Saturday, 24 August 2013

What is the difference between String and Character Array?

String  have static storage duration, While character array not, unless it is specified by using the static  keyword.
Moreover a string is a character array having properties: 
  • the sequence of character, generally call string, is  an array .This array contain all characters plus a NULL character.
  • we cant modify it.
  • two string having same value may share same memory .
DECLARATION: 
char a[ ] = "Kumar and Bucky”; Character Array 
char *s = “Calvin and Hobbes”;     String


0 comments:

Post a Comment