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


Related Posts:

  • Operators in C An operator is a symbol that instruct  the compiler to perform specific mathematical or logical operation. C language  has following type of operators: C Programming •  Arithmetic Operators •  … Read More
  • Loops in C  This is an attempt at explaining the loops in C .It is not complete, just the basics. C Programming Loop is  a construct which execute a set of statements certain number of times… Read More
  • Constant and Literals in c The constants refer to fixed values that the program may not change during its execution. These values are also called literals. C Programming Constants can be of any of the  data types like an integer … Read More
  • Pointers in c  A pointer is an address. Instead of  a variable, it is a pointer to a variable which is  stored somewhere in the memory of the program. Let  examine… Read More
  • c Basic Syntax The basic structure of C programming is easy and it will be help full to understand other building blocks of the C programming language. C Programming Tokens: A token in c programming is either a keyword,… Read More

0 comments:

Post a Comment