LOGBOOK

HELP

Quiz Entry - updated: 2026.07.14

How are strings represented in C?

A C string is an array of ASCII bytes ending in a null byte (\0) that marks where it stops.

String "01234" in memory:

Index 0 1 2 3 4 5
Char '0' '1' '2' '3' '4' '\0'
Hex 0x30 0x31 0x32 0x33 0x34 0x00

Key facts:

  • ASCII digit N has value 0x30 + N (e.g., '5' = 0x35)
  • Strings are byte-order independent (always sequential)
  • Null terminator (\0) marks the end

Go deeper:

From Quiz: REVE1 / Number Representations | Updated: Jul 14, 2026