Learn C: Arrays and Strings
Store collections of values in C: declare, initialize and index arrays, measure them with sizeof, loop over them safely, model grids with two-dimensional arrays, then handle text as null-terminated char arrays with the string.h functions, ending with a word-puzzle project.
- Beginner level
- 3 modules
- 11 lessons
- 43 tasks and questions
Syllabus
01ArraysGroup many values of one type under one name: create and initialize arrays, read and change elements by index, find the length with sizeof, loop over every element, stay inside the bounds, and model grids with two-dimensional arrays.5 lessons
02StringsHandle text in C: strings as char arrays ending in a null character, reading and changing single characters, measuring, copying and joining with string.h and snprintf, and comparing and searching inside strings.4 lessons
03Project: Letters and RunsCombine arrays and strings in two small programs: a letter counter built on an array of 26 counters, and a run-length encoder that packs repeated characters into a short code and unpacks them again.2 lessons