Character Arrays and Strings — Study Resources & PYQs
Declaration, initialization and operations on character arrays and strings.
- Estimated study time: 90 minutes
Study resources
- Strings in C - GeeksforGeeks (Article) — Explains that C has no string type, only char arrays terminated by the null character. Every string bug students hit traces back to a missing or misunderstood '\0', so read this first.
- C String Functions - Programiz (Article) — The string.h functions with examples for each. Also explains why you cannot compare strings with == and must use strcmp instead.
- Array of Strings in C - GeeksforGeeks (Article) — Compares the 2D char array approach with the array-of-pointers approach, including the memory wastage in the first. Good bridge into pointers.
- Storage for Strings in C - GeeksforGeeks (Article) — Explains why a string literal assigned to a char pointer is read-only while a char array is modifiable. This is the source of a classic crash students cannot otherwise explain.
- C Strings and Arrays Interview Questions - GeeksforGeeks (Article) — Short questions with code snippets and answers covering arrays, strings and the null terminator. Works well as a self-test after finishing the unit.
Taught in these subjects
- COMPUTER PROGRAMMING — BCST11 · Government College of Engineering and Technology, Jammu