CHAPTER 19 / 26

C Strings

Learn how to work with character arrays and C strings.

01 — Syntax

char name[] = "text";

02 — Example

#include <stdio.h>

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

03 — Important Points

04 — Common Mistakes

05 — Real-World Use

Strings are used for names, messages, paths and text processing.

06 — Practice

Create a small program that demonstrates the main idea of C Strings.

▶ Try It Yourself← PreviousNext →All Chapters