C Standard Library
For a reader who reaches for a dependency before checking what the standard library already does. Works through string.h, stdio.h, stdlib.h, ctype.h, time.h, and the fixed-width types in stdint.h and limits.h, with every answer checked against what the C standard actually guarantees.
Who it is for
Reaches for a dependency before the built-in.
The behaviour people get wrong after they are already productive in the language.
You will get the most out of it if you have written C recently enough to read it without effort, and have been surprised by it at least once. If you are picking the language up for the first time, start with C Essentials and come back to this one.
How long it takes
90 graded questions at roughly 45 seconds each is about 68 minutes of answering in total.
At the default five questions a day, and because the session mixes in your other courses, expect around 18 days — call it 3 weeks — to see everything once, plus a few weeks of thinning reviews after that before it is all mastered.
A question is mastered on the third correct answer, once the gap between reviews has grown past a week — so a course cannot be finished in a weekend however long you sit with it.
Question mix
- 60 multiple choice
- 10 concept cards
- 10 predict the output
- 10 put it in order
- 10 matching questions
Syllabus
What you will be asked about
-
01
memcpy vs memmove
Choose memcpy or memmove correctly based on whether the source and destination ranges can overlap.
-
02
strcmp and Friends
Read strcmp's return value as a sign, never a magnitude, and reach for strncmp for prefix checks.
-
03
strtok and Hidden State
Track strtok's hidden static state across calls and know that it mutates its input string.
-
04
printf Conversions
Match printf conversions to the argument type they expect and predict exactly what each renders.
-
05
printf Width and Precision
Predict how width, precision, and flags change printf's padding, truncation, and justification.
-
06
puts, printf, and Return Values
Distinguish puts from printf and fputs, and use printf's own return value as a character count.
-
07
sscanf and strtol
Read sscanf's return value as a conversion count and use strtol's endptr to see what it consumed.
-
08
snprintf and Truncation
Use snprintf's return value to detect truncation instead of trusting the buffer's contents alone.
-
09
abs, div, and qsort
Use qsort with a correctly signed comparator and read abs and div without assuming floor division.
-
10
ctype, strftime, and Fixed Widths
Classify characters safely, format a fixed struct tm with strftime, and use stdint.h's guaranteed widths.
8 more topics, and all 90 questions
C Standard Library is a Pro course. One subscription opens it and every other course in the catalogue, including the ones still being written.
A question from this course
memcpy vs memmove
What does this print?
#include <stdio.h>
#include <string.h>
int main(void) {
int src[5] = {10, 20, 30, 40, 50};
int dst[5];
memcpy(dst, src, 3 * sizeof(src[0]));
dst[3] = 0; dst[4] = 0;
for (int i = 0; i < 5; i++) printf("%d ", dst[i]);
printf("\n");
return 0;
}
Show the answer
A 10 20 30 0 0
You may have expected memcpy to copy the whole 5-element array because both arrays are declared the same size, but the byte count passed is 3 * sizeof(int) - exactly three elements. The remaining two slots keep whatever main explicitly set them to, which here is zero, not leftover garbage from src.
The rest of the track
C at every depth
C Essentials
Covers C's basic types and integer promotion, operator precedence, control flow, functions and parameters, arrays, strings as char arrays, introductory pointers, printf specifiers, scope and lifetime, and const - the syntax a beginner reaches for first. Every item runs against a real compiler, so the surprising cases are proven rather than asserted.
C Core
Covers pointer arithmetic, arrays decaying to pointers, where const actually applies, struct assignment, malloc/free and ownership, the strcpy family, integer conversion and promotion, the ternary and comma operators, and static at file and block scope. Aimed at someone who already writes C daily but has never had the gap between what compiles and what is correct made explicit.
C Data & Collections
Arrays decay to pointers the instant they cross a function boundary, and every container in C is really addresses and strides under a comfortable-looking syntax. This course puts pressure on that comfort: row-major layout, struct-embedded arrays, flexible array members, qsort comparators, realloc growth, and hand-built linked lists, until the mental model matches what the compiler actually does.
C Errors & Edge Cases
Most C code you have seen handles the case where everything works; this course is about the returns, allocations, and reads that fail, and what checking them properly looks like in practice. It covers return codes versus errno, partial transfers, strtol and strncpy's sharp edges, off-by-one bounds, integer overflow before malloc, and the goto-cleanup and assert idioms that keep a program correct under failure.
C Idioms & Pitfalls
For a reader who is fluent in C but still writes it like another language. Works through the array-length macro's function-parameter trap, const placement, designated initializers, compound literals, both meanings of static, header guards, function-pointer dispatch tables, restrict, X-macros, and the copy-semantics mistakes that leak in from Java, Python, or C++.
C Advanced
Pointers to pointers, function pointers, unions, variadic functions, the preprocessor, recursion, setjmp/longjmp, opaque pointers and _Generic - the traps a confident C developer trips over. Every answer here is guaranteed by the standard, never by one compiler's mood on one machine.
C Performance
Complexity you can count instead of guess: linear scans, strlen in a loop condition, memcpy versus a byte loop, realloc growth, buffered output, struct passing, static linkage, and hoisting invariant work. Every answer here is an operation count or a call count, checked by running the code - never a clock reading.
C Testing
Ten spines on testing C the way it actually gets tested: hand-rolled CHECK macros, what NDEBUG deletes from an assert, seams built from function pointers, forcing the allocation-failure branch on purpose, and comparing floating point with a tolerance instead of ==. Every graded snippet is checked to give the same answer on every machine, and several items exist to catch a test that looks reasonable but could never actually fail.
C Interview Questions
Ten spines of the C questions that come up when time is short: string and pointer traps, linked-list rewiring, bit tricks and const rules, each one checked to give the same answer on every machine. The items built on a premise the language does not actually guarantee - char signedness, argument evaluation order, signed overflow - explain why, instead of faking a single output.
Start C Standard Library
in tomorrow’s session.
Enrol and this course joins your daily five, mixed in with everything else you are studying — 90 questions spread over about 18 days rather than dropped on you at once.
Browse the catalogue