String Basics:

A string in C is a sequence of characters stored in a character array and
terminated by a special null character ('\0'). The null character marks the end
of the string and allows string-handling functions to determine the string’s
length.

Strings are commonly used to store names, messages, and other textual data.
Unlike numeric arrays, strings require careful handling to ensure proper
termination.
SYNTAX:

char name[10] = "Coca";
EXAMPLE:

#include <stdio.h>
#include <string.h>

int main() {
    char s1[] = "CocaCola";
    printf("%s", s1);
   

    return 0;
}
Previous Next