C String Constant



String Constant in C Programming Language :

  1. String is “Sequence of Characters“.
  2. String Constant is written in Pair of Double Quotes.
  3. String is declared as Array of Characters.
  4. In C , String data type is not available.
  5. Single Character String Does not have Equivalent Integer Value i.e ASCII Value

Different Constant Values Contained inside String :

String with Single Character

"a"

String With Multiple Characters

"Ali"

String With Digits

"123"

String With Blanks

"How are You"

Note :

1] 'A' is not Equal to "A"
2] 'A' ==> Requires 1 byte Memory
3] "A" ==> Requires 2 byte Memory

Summary :

Example Meaning
“a” String with Single Character
“Ali” String With Multiple Characters
“123? String With Digits
“How are You” String With Blanks