C Language

String in c

In C Language by Baqir AliLeave a Comment

A string constant is one-dimensional array of characters terminated by a null(‘\o\).

For Example

char name[]={‘s’,’a’,’d’,’I’,’q’};

Each Character in the array occupies one byte of memory and the last character is always ‘\0’, The terminating null (‘\0’) is important because it is the only way the functions that work with a string can know where the string ends.

Leave a Comment