Skip to content
UPEEC

Strings in C

Arrays of `char` ending with a null byte `'\0'`.

Beginner
Comments 0

char name[] = "UPEEC"; occupies 6 bytes. Forgetting room for '\0' is a very common bug. String literals are read-only — don't modify char *s = "text";.

Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.

Discussion (0)

Sign in or join free to ask questions and discuss this topic.