Step Into Labs

Step Into C · Lesson 8 · Arrays & Strings

Strings

Null-terminated char arrays, string.h, safe input with fgets.

Part of Step Into C. The full lesson, its missions and the real compiler and debugger are in the course. Try a free lesson first to see how it works.

C has no string type. A string is an array of char that ends with a null terminator: the byte '\0', whose value is 0. That terminator is how every string function knows where the text stops.

In this lesson

Missions

  1. Your own strlen
  2. SHOUT
  3. Who are you?
  4. Recognise a regular