Strings in C

Previous
Next

String:

  • String is a one dimensional character array.
  • String is a collection symbols(alphabets, digits and special symbols).
  • Strings must be represented with double quotes.

Syntax :

            char  identity[size] ;

Example:

            char  name[20];

  • Character occupies 1 byte memory
  • String variable holds base address of block
  • We can store only ‘n-1’ characters into an array of size ‘n’.
  • Last character of every string is ‘\0’
  • ASCII value of ‘\0’ character is 0.
Previous
Next

Add Comment

Courses Enquiry Form