strings

C Strings

C Strings

A string in C is an array of characters terminated by a null character '\0'.

Working with Strings

#include 

int main() {
    char name[] = "John Doe";
    printf("Name: %s\n", name);
    return 0;
}
    

This program demonstrates how to declare and print a string.