Bring the ideas
back into focus.
A recap, a useful distinction, and an optional concept check for every chapter. Start with your saved chapters or choose an idea to return to later.
Revision choices are optional and stay in this browser. You choose chapter completion separately.
No topics match this view. Reset the filters to explore the rest.
01What is programming?No revision choice yet
Recall three ideas
- A specification states the allowed inputs, required results, and failure rules.
- An algorithm describes a method; a program expresses work in a language.
- A successful build does not establish that the program solves the intended problem.
How would you describe the rules for a canteen bill before writing any C?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- The computer follows specified operations, so missing decisions must be made explicit.
✓ Correct reasoning. A program needs rules for the situations it handles; an unstated intention is not an instruction.
- The computer always guesses the programmer’s intention.
A programmer’s intended meaning does not replace the language’s rules.
- Precise instructions make every program correct.
Precision helps express a plan, but the plan can still contain a mistake.
General
Connect this topic to other ideas
Builds on
No earlier chapter is required. Check the chapter guide for background assumptions.
Chapters that build on this topic
02How computers follow instructionsNo revision choice yet
Recall three ideas
- State is the information needed to describe a program’s current situation.
- A trace records selected steps and their effects on that state.
- A loop intended to finish needs a reason that it reaches an exit.
What would you record to explain a counter that changes from four to five and then stops?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- Yes, line breaks define processor operations.
Source layout does not establish a one-to-one instruction count.
- Yes, comments each require a machine instruction.
Comments are not runtime instructions.
- No. Translation and optimization can produce a different arrangement.
✓ Correct reasoning. Reason from language semantics before assuming a particular machine-level trace.
General
Connect this topic to other ideas
Builds on
Chapters that build on this topic
03CPU, memory, storage, and the operating systemNo revision choice yet
Recall three ideas
- The processor, working memory, storage, and operating system have different roles.
- A running process has state that differs from the stored executable file.
- Saving data requires a suitable successful operation beyond changing a working value.
Why can two running copies of the same program show different current values?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- RAM and persistent storage are interchangeable.
Working memory and persistent storage have different roles and persistence properties.
- Working memory and persistent storage serve different roles.
✓ Correct reasoning. Saving normally writes data to persistent storage; keeping a value in working memory is a different operation.
- A CPU permanently saves every intermediate value.
Executing operations does not automatically create a persistent copy of every value.
General
Connect this topic to other ideas
Builds on
Chapters that build on this topic
04Why programming languages existNo revision choice yet
Recall three ideas
- A programming language supplies notation and rules for expressing work.
- Syntax, meaning, and implementation strategy answer different questions.
- C types and interfaces help organise work while leaving explicit responsibilities with the programmer.
What would you explain first to someone who asks what int means, before discussing its size?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- Yes. Following the grammar does not prove the intended logic.
✓ Correct reasoning. Syntax, language meaning, and the problem’s requirements are different questions.
- No, grammar checks every real-world requirement.
A parser does not know every intended requirement.
- No, accepted code must produce the intended answer for all inputs.
Acceptance alone is not that correctness guarantee.
General
Connect this topic to other ideas
Chapters that build on this topic
05Why C was createdNo revision choice yet
Recall three ideas
- C developed from earlier language ideas alongside practical Unix systems work.
- Types and structured operations helped express systems data beyond machine-specific instructions.
- Portability still depends on language guarantees and documented environment assumptions.
Which problem helped make C useful for Unix, and why did that not make every C program automatically portable?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- Implementing systems software, including Unix.
✓ Correct reasoning. C developed alongside Unix and grew from earlier systems-language work.
- Guaranteeing that every program works unchanged on every machine.
C’s history does not remove a program’s implementation and environment assumptions.
- Replacing every machine-specific operation with automatic safety checks.
C still requires explicit attention to bounds, lifetimes, and interfaces.
General
Connect this topic to other ideas
Builds on
Chapters that build on this topic
06From source code to a running programNo revision choice yet
Recall three ideas
- Saving source, building a program, and running it are separate actions.
- Headers provide translation information; required definitions must still be supplied.
- An executable can build successfully and later fail because its runtime environment lacks a resource.
How would you explain a program that translates but fails because a function definition is missing?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- The complete executable body.
A declaration describes the function’s interface; its body is a definition.
- A guarantee that linking succeeds.
The build still needs the definitions required by the program.
- Information needed to check uses of the function.
✓ Correct reasoning. A suitable declaration supports checking calls, but it does not supply the missing body.
C17
Connect this topic to other ideas
Chapters that build on this topic
07Variables, values, and typesNo revision choice yet
Recall three ideas
- A name, an object, its type, and its current value are different ideas.
- Initialisation supplies a starting value; later assignment stores another suitable value.
- Copying an integer value creates no permanent connection between the objects’ later values.
After copying apples into saved, why can changing apples leave saved unchanged?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- saved automatically follows apples.
The initializer copied an int value; it did not create a live connection between the objects.
- saved keeps its copied value until it is changed separately.
✓ Correct reasoning. The objects are separate. Changing one does not itself assign to the other.
- saved ceases to exist.
An assignment to apples does not end saved’s lifetime.
C17
Connect this topic to other ideas
Builds on
No earlier chapter is required. Check the chapter guide for background assumptions.
Chapters that build on this topic
08Data types, ranges, and representationsNo revision choice yet
Recall three ideas
- Types govern values, operations, ranges, and conversions, as well as storage requirements.
- Unsigned wrapping and ordinary signed overflow follow different rules.
- C bytes and floating-point formats need implementation-specific properties when exact limits matter.
Which properties would you check before choosing a type for counts and measured lengths?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- It is always 8.
Eight is a common number of bits in a byte, not the value of sizeof(char).
- It equals sizeof(int) on every implementation.
The standard does not require those two sizes to be equal.
- It is 1, measured in C bytes.
✓ Correct reasoning. A C byte is the size of char. CHAR_BIT specifies how many bits that byte contains.
C17
Connect this topic to other ideas
09Declarations, initialization, and assignmentNo revision choice yet
Recall three ideas
- A declaration introduces information about a name; some declarations also define an entity.
- An initializer belongs to a definition and differs from a later assignment expression.
- Starting-value rules depend on the object’s storage duration and declaration context.
Why is a const object allowed to receive an initial value even though later modification is restricted?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- Initialization supplies an initial value; assignment later stores a value in an existing modifiable object.
✓ Correct reasoning. Both can involve values, but they occur in different language contexts and can have different rules.
- Assignment creates a new variable name every time.
Assigning to an existing object does not introduce a new identifier.
- Every local declaration initializes an int to zero.
An ordinary automatic int without an initializer does not receive an implicit zero value.
C17
Connect this topic to other ideas
10Reading C: tokens, expressions, and statementsNo revision choice yet
Recall three ideas
- C recognises tokens and combines them according to grammar.
- Expressions, declarations, and statements can share punctuation while doing different jobs.
- Whitespace can separate tokens, and literal text can contain spaces that are data.
How would you separate the parts of int total = count + 1; without calling the whole line an expression?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- In expressions, = assigns and == compares for equality.
✓ Correct reasoning. Their expression roles differ. The = token also appears in initialization syntax, where it is not an assignment expression.
- Whitespace decides whether both mean assignment.
Whitespace does not make these two operators interchangeable.
- The compiler chooses their meaning from the programmer’s intention.
The language’s token and expression rules determine their roles.
C17
Connect this topic to other ideas
Chapters that build on this topic
11Expressions and operators: meaning before precedenceNo revision choice yet
Recall three ideas
- Operand types and conversions help determine an operation’s meaning.
- Precedence and associativity describe grouping, rather than generally fixing evaluation order.
- Short-circuit logical operators provide specific evaluation guarantees; bitwise operators have different jobs.
Why can a guard using && prevent a division, while adding parentheses alone may not establish an evaluation order?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- Yes, precedence is a timeline.
Precedence groups expressions; evaluation order is a separate set of rules.
- No. Grouping and evaluation order are separate rules.
✓ Correct reasoning. Parentheses and precedence help determine expression structure; sequencing rules determine required ordering.
- Adding parentheses always fixes unsequenced side effects.
Grouping alone does not introduce sequencing where the language does not specify it.
C17
Connect this topic to other ideas
12Conditions, choices, and loopsNo revision choice yet
Recall three ideas
- Conditions choose a path using the state examined at that point.
- A loop trace should show the test, body, update, and exit.
- break, continue, and return transfer control according to different enclosing constructs.
What state would you trace to check whether a loop runs zero, one, or one-too-many times?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- while always runs once before checking.
That is not while’s control rule; its condition is checked before entering the body.
- The compiler removes every loop.
Loop behavior follows the program’s semantics, not a universal removal rule.
- Its controlling expression can be false at the first check.
✓ Correct reasoning. A false initial condition prevents the first body execution.
C17
Connect this topic to other ideas
13Functions: inputs, results, and contractsNo revision choice yet
Recall three ideas
- A declaration, definition, and call describe different parts of using a function.
- C passes argument values to parameters; copied pointers can still access shared targets.
- A function’s useful contract includes ranges, effects, and failure behavior beyond its type signature.
How can a function change a caller’s object through a pointer while argument passing remains by value?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- No. The pointer value is copied, and the copy can refer to a shared object.
✓ Correct reasoning. The function may modify a permitted pointed-to object, while its parameter is still a separate pointer object.
- Yes, pointer parameters are aliases for the caller’s pointer variable.
A pointer parameter receives a value; assigning that parameter does not directly assign the caller’s pointer object.
- A pointer argument copies the whole pointed-to allocation.
Copying a pointer value does not copy the objects it refers to.
C17
Connect this topic to other ideas
14Recursion: following separate callsNo revision choice yet
Recall three ideas
- A recursive design needs a stopping case and a justified reduction toward it.
- Each invocation has separate parameters and ordinary automatic local instances.
- Finite arithmetic, call depth, and repeated work still need explicit limits.
Why does triangle(3) need triangle(2), and which result allows the first waiting addition to finish?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- Yes, the presence of the branch forces every call to reach it.
A branch that is never reached cannot stop the recursion.
- Yes, C guarantees unlimited call depth.
Resource use and call depth are not unlimited portable guarantees.
- No. The calls need justified progress toward a stopping condition and resource limits.
✓ Correct reasoning. A sound argument also considers valid inputs, arithmetic, depth, and repeated work.
C17
Connect this topic to other ideas
Chapters that build on this topic
This topic is a review or a deeper endpoint in this learning path.
15Comments: explaining intent in CNo revision choice yet
Recall three ideas
- Comments explain intent without becoming ordinary executed operations.
- Comment replacement, literals, and line splicing affect how source is interpreted.
- A useful comment records a reason or contract and must stay consistent with the code.
Why can deleting comment characters carelessly change token boundaries or expose unintended source?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- The comment is replaced by whitespace, separating the tokens.
✓ Correct reasoning. It does not join int and count into a single identifier.
- The comment executes before the declaration.
Comments are handled during translation, not executed as runtime statements.
- The characters become the identifier intcount.
Comment replacement supplies separation instead of concatenating these tokens.
C17
Connect this topic to other ideas
Chapters that build on this topic
16Qualifiers: read-only access and observable effectsNo revision choice yet
Recall three ideas
- Qualifiers apply to particular types and access paths in a declaration.
- const access restricts modification through that path without freezing every alias to a mutable target.
- volatile, restrict, and atomic facilities have specific contracts that do not replace one another.
What would you inspect to identify which part of a pointer declaration const qualifies?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- No. This access path is read-only, but another permitted access can modify the original object.
✓ Correct reasoning. This does not permit modifying an object that was originally defined as const.
- Yes, every alias becomes read-only automatically.
Qualifying one access path does not rewrite all other pointer objects and types.
- The pointed-to object is copied into the pointer.
A pointer value refers to an object; it does not contain a copy of that object.
C17
Connect this topic to other ideas
17Storage classes: duration, scope, and linkageNo revision choice yet
Recall three ideas
- Scope, storage duration, and linkage describe different properties.
- Objects with static storage duration persist for program execution; thread-duration objects are associated with a thread.
- A storage-class keyword must be read in its declaration context rather than as a universal lifetime shortcut.
How can a local static object outlive one execution of the block while its name stays block-scoped?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- Static storage duration and internal linkage.
✓ Correct reasoning. These describe object duration and identifier linkage; the name is declared at file scope.
- Automatic duration limited to one function call.
A file-scope object does not have ordinary automatic duration.
- A fresh dynamic allocation whenever the name is used.
Referencing the name does not perform a new allocation.
C17
Connect this topic to other ideas
18Constants, constant expressions, and compile-time checksNo revision choice yet
Recall three ideas
- Literals, enumeration constants, read-only objects, and constant expressions are distinct categories.
- A context may require an integer constant expression rather than merely an unchanged runtime value.
- C23 constexpr objects follow their own rules and do not supply C++ constexpr functions.
Why can two declarations with the same numeric value be accepted in different compile-time contexts?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- Yes, const has the same role as every compile-time constant facility.
Read-only qualification and integer-constant-expression rules are different concepts.
- No. const qualification alone does not satisfy that rule.
✓ Correct reasoning. Use a form allowed by the relevant constant-expression context, such as an appropriate enumerator or integer constant.
- It makes every array using n invalid in every context.
A nonconstant bound can instead form a VLA where that facility and context are supported.
C17
Connect this topic to other ideas
Builds on
Chapters that build on this topic
19Reading keywords by the job they doNo revision choice yet
Recall three ideas
- Keywords become easier to interpret when grouped by their jobs.
- A spelling can participate in declarations, control flow, or special expression rules depending on its role.
- New spellings and semantic changes must be associated with the selected C edition.
Choose one keyword and explain its job using a rule and a small example rather than a memorised label.
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- Always terminate the entire program immediately.
Returning from an ordinary called function normally resumes its caller.
- Repeat the function body.
return ends the current invocation rather than starting another iteration.
- Finish the current function invocation, supplying a value when required.
✓ Correct reasoning. The function’s return type and return statement determine the value rules.
C17
Connect this topic to other ideas
Builds on
Chapters that build on this topic
20C keyword index: C17 and C23No revision choice yet
Recall three ideas
- This index is a lookup aid linked to the corresponding theory chapters.
- Keyword status and familiar header macros can differ between C17 and C23.
- Recognising a spelling is the start of understanding its constraints and useful contexts.
How would you check whether a familiar spelling is a keyword or a header macro in the edition you use?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- Yes, every standard library name is a keyword.
Library identifiers and language keywords are separate categories.
- No. It names a standard library function declared through <stdio.h>.
✓ Correct reasoning. Including a header supplies declarations; it does not turn the name into a language keyword.
- It becomes a keyword only after its first call.
Calling a function does not change the lexical category of its identifier.
C17
Connect this topic to other ideas
Builds on
Chapters that build on this topic
This topic is a review or a deeper endpoint in this learning path.
21Objects and memoryNo revision choice yet
Recall three ideas
- Objects occupy storage and have types, representations, and lifetimes.
- sizeof measures C bytes; CHAR_BIT describes how many bits one C byte contains.
- A conceptual memory diagram explains relationships without fixing one physical machine layout.
Which facts about an object are guaranteed by C, and which details would you check on the target implementation?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- Yes, a fixed stack layout is part of every C object’s type.
A type does not prescribe a universal machine stack layout.
- No. Storage-duration and lifetime rules do not mandate that physical arrangement.
✓ Correct reasoning. A call stack is a useful common implementation model, with limits that should be stated.
- No local object can be optimized.
Implementations can optimize while preserving required program behavior.
C17
Connect this topic to other ideas
Chapters that build on this topic
22Scope, lifetime, and storage durationNo revision choice yet
Recall three ideas
- Scope describes name visibility; lifetime describes when an object exists.
- Storage duration determines lifetime rules rather than one universal stack diagram.
- A pointer cannot extend a target object’s lifetime merely by retaining its address.
Why can returning an address of an ordinary automatic local object leave the caller without a usable target?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- Its object remains alive, while that name is outside its block scope here.
✓ Correct reasoning. Static storage duration and block scope answer different questions.
- Its object must be destroyed at block exit.
That describes ordinary automatic storage, not a static local’s storage duration.
- Its name becomes globally visible.
Static storage duration does not turn a block-scope identifier into a file-scope identifier.
C17
Connect this topic to other ideas
Chapters that build on this topic
23Understanding pointersNo revision choice yet
Recall three ideas
- A pointer object stores a pointer value and is separate from its target.
- Copying a pointer copies a relationship without copying or extending the target.
- Valid access needs the right target, lifetime, range, type, and permissions.
After q copies p, what changes when p is redirected, and what happens if you then write through q?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- q automatically follows the new p.
The assignment copied a pointer value, not an ongoing dependency on p.
- q retains its earlier pointer value unless separately changed.
✓ Correct reasoning. The pointer objects are separate even when their values refer to the same target.
- The old target is freed automatically.
Redirecting a pointer does not itself release the old target’s storage.
C17
Connect this topic to other ideas
Chapters that build on this topic
24Understanding arraysNo revision choice yet
Recall three ideas
- An array contains a contiguous sequence of elements of one type.
- Valid indexes identify existing elements, while the one-past pointer is a boundary rather than an element.
- Count and range information must remain consistent with the available storage.
How would you explain the difference between an element count and the largest valid index?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- 3
Indices begin at zero, so index 3 would be outside the three elements.
- It depends on the first stored value.
Element values do not change the indexing range.
- 2
✓ Correct reasoning. The element indices are 0, 1, and 2.
C17
Connect this topic to other ideas
Builds on
Chapters that build on this topic
25Arrays and pointers togetherNo revision choice yet
Recall three ideas
- An array object and a pointer object have different types and roles.
- Many array expressions convert to a pointer to their first element.
- An adjusted array parameter is a pointer, so its sizeof does not recover the caller’s array size.
Why should a function receiving an array view also receive an appropriate element count?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- Form it as one-past, but do not dereference it.
✓ Correct reasoning. The one-past value is a permitted boundary; it does not designate an array element to read.
- Read *(a + 3) because the pointer can be formed.
Being allowed to form a pointer does not make every dereference valid.
- It necessarily points to another object.
C provides no guarantee of another usable object at that boundary.
C17
Connect this topic to other ideas
26Characters, buffers, and stringsNo revision choice yet
Recall three ideas
- A C string ends at its first null character and needs storage for that terminator.
- Capacity measures available storage; strlen measures units before the terminator in a valid string.
- Copies require valid regions, enough space, and the operation’s overlap contract.
What must be true before a string function can safely scan a character buffer?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- Capacity 3, length 6.
This reverses the array’s element count and the character count before the first null.
- Capacity 6, length 3.
✓ Correct reasoning. The array has six elements; strlen excludes the terminating null and stops before it.
- Capacity 6, length 6.
Extra zero-initialized elements do not extend the string past its first null.
C17
Connect this topic to other ideas
Builds on
27Text, Unicode, UTF-8, and localeNo revision choice yet
Recall three ideas
- Storage units, Unicode scalar values, grapheme clusters, and display width measure different things.
- UTF-8 validation does not automatically provide normalization or grapheme boundaries.
- Locale-dependent C conversions require their stated state and error-handling rules.
Why might two strings showing the same accented letter have different strlen results?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- No. It counts char elements before the first null, not grapheme clusters.
✓ Correct reasoning. UTF-8 code points can use several bytes, and one visible unit can involve several code points.
- Yes, every visible letter is exactly one C char.
That is not a general Unicode or UTF-8 guarantee.
- It automatically decodes and normalizes all Unicode text.
strlen searches for the terminating null; it is not a Unicode normalization operation.
C17
Connect this topic to other ideas
Builds on
Chapters that build on this topic
This topic is a review or a deeper endpoint in this learning path.
28Dynamic memory and ownershipNo revision choice yet
Recall three ideas
- Allocation requests a region whose size is chosen while the program runs.
- The program must validate size arithmetic, handle failure, and establish usable values.
- Ownership and borrowing rules determine release and the validity of aliases.
How would you replace an allocation while keeping the original pointer available if resizing fails?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- The old allocation has always been freed.
For this positive-size failure, the old allocation is not deallocated.
- The new third element is ready to use.
A failed growth request did not create that extra space.
- The original allocation, reachable through the preserved owning pointer.
✓ Correct reasoning. Use a temporary result so a failed call does not overwrite the pointer needed to access and release the original allocation.
C17
Connect this topic to other ideas
29Understanding memory mistakesNo revision choice yet
Recall three ideas
- Bounds, lifetime, type, and ownership failures are different memory mistakes.
- A non-null pointer can still be invalid for the requested access.
- Diagnostic tools provide evidence for exercised cases rather than a proof of all possible executions.
Which checks would distinguish a buffer overrun from a use-after-free in a small failing example?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- No. Other pointer objects do not update automatically.
✓ Correct reasoning. Ownership and alias lifetimes need a contract; clearing one pointer only changes that pointer object.
- Yes, free finds and clears all aliases.
free releases allocated storage; it does not locate and rewrite all pointer objects.
- Yes, NULL releases the same allocation again.
Assigning NULL is an assignment, not another deallocation operation.
C17
Connect this topic to other ideas
Chapters that build on this topic
30Structures: related dataNo revision choice yet
Recall three ideas
- A structure type describes named members, and each structure object holds member values.
- A contained array belongs to the structure object; a pointer member can refer elsewhere.
- Member types and relationships determine which record states make sense.
Why does a record with a pointer member need a lifetime contract for the referenced data?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- Its entire pointed-to allocation is duplicated automatically.
Structure assignment does not provide an automatic deep-copy ownership policy.
- The pointer value is copied, so both members can refer to the same object.
✓ Correct reasoning. Any ownership or independent-copy requirement needs an additional contract.
- The original allocation is released.
Assigning a structure does not itself call free on pointer members.
C17
Connect this topic to other ideas
Chapters that build on this topic
31Structure values and functionsNo revision choice yet
Recall three ideas
- Copying a structure copies its member values.
- A copied pointer member can keep two records connected to the same target.
- Logical comparison and external serialization require policies beyond copying object bytes.
Which changes affect only a copied record, and which can affect a shared pointer target?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- Assigning a new integer directly to the copied structure’s int member.
That member belongs to the separate parameter object.
- A permitted write through a copied pointer member that still refers to the shared object.
✓ Correct reasoning. Copying a structure does not automatically copy the objects its pointer members refer to.
- Changing any parameter necessarily replaces the caller’s whole structure.
The structure parameter is a separate object.
C17
Connect this topic to other ideas
Chapters that build on this topic
32Enumerations: named choicesNo revision choice yet
Recall three ideas
- Enumeration constants provide meaningful names for choices.
- The language rules for values and types differ in specific C17 and C23 cases.
- External integers still need validation against the application’s accepted choices.
Why should a menu command read from a file be checked before treating it as a named enum choice?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- Yes, an enum ignores explicitly supplied values.
Explicit enumerator initializers are meaningful.
- Its value changes each time it is read.
An enumerator is a named integer constant, not a runtime counter.
- No. BUSY is explicitly given the value 7.
✓ Correct reasoning. Sequential defaults do not override an explicit initializer.
C17
Connect this topic to other ideas
Chapters that build on this topic
33Unions and tagged dataNo revision choice yet
Recall three ideas
- Union members share storage rather than each receiving separate simultaneous storage.
- A tag can identify which interpretation the program intends.
- The program must preserve the relationship between the tag, stored data, and permitted accesses.
What should an update do to keep a tagged union’s chosen form and data consistent?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- The program, through its construction and access contract.
✓ Correct reasoning. Assigning a union member does not automatically update a separate tag field.
- The union updates every separate tag automatically.
C provides no such automatic relationship for an ordinary separate tag field.
- No tag is needed because every union member has separate storage.
Union members share storage; the intended interpretation needs a clear contract.
C17
Connect this topic to other ideas
Chapters that build on this topic
34Initializing records and aggregatesNo revision choice yet
Recall three ideas
- Aggregate initialisers set member and element starting values under their type rules.
- Designators name selected members or elements without changing the object’s layout.
- Compound literals create objects whose lifetime depends on their context and version-specific rules.
Why can a designated initializer make a record’s intended starting state clearer to a reader?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- They both repeat 1.
A partial initializer does not repeat the last explicitly supplied value.
- They are initialized to zero.
✓ Correct reasoning. The remaining aggregate elements receive the implicit initialization specified by the language.
- They must contain arbitrary uninitialized values.
This aggregate has an initializer; its omitted elements are not treated like an uninitialized automatic int.
C17
Connect this topic to other ideas
Chapters that build on this topic
35Padding, alignment, and layoutNo revision choice yet
Recall three ideas
- Alignment constrains which storage positions are suitable for a type.
- Structure padding can make sizeof exceed the sum of member sizes.
- Layout details and bit-field behavior need implementation-aware checks and explicit external-format rules.
Why can comparing complete structure bytes fail to express the equality your application wants?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- Yes, every structure contains only its meaningful values and no padding.
Implementations can insert padding, and representations need not provide this general guarantee.
- No. Padding and representations can make byte comparison unsuitable for value equality.
✓ Correct reasoning. Compare meaningful members according to the equality your program intends.
- memcmp always performs a member-by-member semantic comparison.
memcmp compares bytes, not the meanings of structure members.
C17
Connect this topic to other ideas
Chapters that build on this topic
36Flexible array membersNo revision choice yet
Recall three ideas
- A flexible array member supports trailing elements after a structure’s fixed members.
- Checked allocation arithmetic must provide storage for the intended tail.
- Logical length, initialised payload, and actual capacity must stay consistent.
Which calculations and initialisations are needed before a flexible-array record can expose its payload?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- Yes, the array grows automatically to match the count.
A count assignment does not acquire storage.
- Yes, sizeof the header always includes any desired payload.
The type’s fixed size does not supply arbitrary extra payload capacity.
- No. The allocation must separately provide sufficient checked capacity.
✓ Correct reasoning. Keep the count, allocation size, and bounds consistent; check size arithmetic before allocating.
C17
Connect this topic to other ideas
Chapters that build on this topic
37Types, declarations, and data interfacesNo revision choice yet
Recall three ideas
- A typedef gives a type another name and can hide pointer details.
- Qualifiers apply to the actual aliased type, so declarator structure matters.
- Useful data interfaces state valid states, mutation, ownership, lifetime, and failure behavior.
How can a pointer typedef change the meaning you first expect from a const declaration?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- Both a and b.
The star belongs to a’s declarator, not automatically to every name in the declaration.
- Only b.
The star is attached to a’s declarator.
- Only a; b has type int.
✓ Correct reasoning. Read each declarator separately with the shared type specifier.
C17
Connect this topic to other ideas
Chapters that build on this topic
38Function pointers and callbacksNo revision choice yet
Recall three ideas
- A function pointer selects a function without copying its code.
- An indirect call must use a compatible function type and meet the called function’s contract.
- A callback’s timing, context data, and concurrency rules come from the receiving API.
What agreement does a caller need before giving another operation a callback and a data pointer?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- No. The eventual call must use a compatible function type.
✓ Correct reasoning. A cast does not change the function’s parameter and return contract.
- Yes, casting rewrites the function’s parameter types.
Converting a pointer does not rewrite the function’s definition.
- Yes, every pointer type has identical call semantics.
Object and function pointer roles and compatible function types still matter.
C17
Connect this topic to other ideas
Builds on
Chapters that build on this topic
39Preprocessing: preparing the sourceNo revision choice yet
Recall three ideas
- Preprocessing handles directives and replacement before ordinary C semantic analysis.
- A preprocessor condition selects source rather than testing a runtime object.
- Configuration choices must leave valid declarations and compatible interfaces in the included source.
How does #if selecting source differ from an ordinary if choosing a runtime path?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- Both select runtime branches in the same way.
#if is handled during preprocessing rather than as an ordinary runtime statement.
- #if selects source during preprocessing; if selects a path in ordinary execution.
✓ Correct reasoning. Conditional inclusion determines which source tokens proceed into later translation.
- #if can inspect every runtime variable’s current value.
Preprocessing condition rules do not provide access to future runtime object values.
C17
Connect this topic to other ideas
40Macros: tokens, arguments, and pitfallsNo revision choice yet
Recall three ideas
- Macros replace preprocessing tokens rather than receiving typed argument values like functions.
- Parentheses can repair grouping without preventing repeated evaluation.
- Stringizing, token pasting, and conditional forms require their specific preprocessing rules.
Why might a small typed function be a clearer choice than a function-like macro with a side-effecting argument?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- Macro arguments are always evaluated exactly once.
Token substitution does not provide a function-call-style single evaluation guarantee.
- Expansion can evaluate that expression more than once, with sequencing concerns.
✓ Correct reasoning. Inspect the replacement tokens and sequencing; do not invent an output for an invalid expansion.
- Parentheses automatically remove every repeated side effect.
Parentheses can improve grouping without removing duplicated evaluations.
C17
Connect this topic to other ideas
Builds on
Chapters that build on this topic
This topic is a review or a deeper endpoint in this learning path.
41Headers: sharing an interfaceNo revision choice yet
Recall three ideas
- Headers share interface information needed during translation.
- Guards can prevent repeated inclusion within a translation unit.
- A header must be designed around declarations and any definitions permitted by the relevant linkage rules.
What should a header include to remain usable when another source file includes it by itself?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- Including a header always links a library.
Header inclusion and supplying compiled definitions are separate build concerns.
- A header is a separate running program.
Headers supply source through inclusion; they do not run as independent programs.
- To share a consistent interface across translation units.
✓ Correct reasoning. The declarations can be included where functions are used and where their definitions are checked.
C17
Connect this topic to other ideas
42Translation units and linkageNo revision choice yet
Recall three ideas
- Each translation unit has its own preprocessing and declaration context.
- Linkage connects declarations referring to the same entity across appropriate contexts.
- Shared interfaces require compatible declarations and the correct program-level definitions.
How can two files both translate yet disagree about the interface of the entity they try to share?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- No. Their identifiers have internal linkage in their respective translation units.
✓ Correct reasoning. Matching spelling does not establish shared external identity for internal-linkage identifiers.
- Yes, every matching spelling names one global object.
Scope and linkage rules matter; matching text alone is insufficient.
- static always means block scope.
static can appear in file-scope declarations too; scope depends on declaration location.
C17
Connect this topic to other ideas
Chapters that build on this topic
43Linking and librariesNo revision choice yet
Recall three ideas
- Linking connects references with the definitions supplied to a build.
- Static archives and shared libraries package components under toolchain-specific rules.
- A compatible name alone does not establish the full ABI and ownership contract.
Which evidence would separate a missing definition from an incompatible declaration or unavailable shared dependency?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- The declaration supports type checking; the build still needs the required implementation.
✓ Correct reasoning. How a toolchain supplies library definitions is separate from header inclusion.
- Including a header always builds every library on the computer.
Header inclusion supplies source declarations, not a universal library-build operation.
- Every C implementation requires the same library command-line flags.
Toolchain flags are implementation-specific interfaces.
C17
Connect this topic to other ideas
Builds on
44The standard library: facilities and contractsNo revision choice yet
Recall three ideas
- Library facilities are organised by the jobs they support.
- Each call has argument, storage, result, and failure rules.
- Hosted, freestanding, optional, and platform-specific facilities have different availability contracts.
What would you check in a library function’s documentation before passing it a pointer and a count?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- Yes, the library repairs all invalid pointers.
A library interface does not remove the caller’s pointer and lifetime obligations.
- Yes, a header guarantees successful resource acquisition.
Operations such as allocation and file opening can still fail.
- No. The caller must also satisfy the function’s argument and state contracts.
✓ Correct reasoning. Bounds, formats, lifetimes, and error handling remain part of correct use.
C17
Connect this topic to other ideas
Builds on
45Modular programs: contracts and buildsNo revision choice yet
Recall three ideas
- A module should have a coherent responsibility and a clear interface.
- Private representation and helpers can reduce the state other code must understand.
- Build dependencies must account for shared interface changes, as well as implementation files.
How would you describe a module’s accepted inputs and unchanged-on-rejection policy to another programmer?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- Including the interface header automatically supplies every definition.
Declarations in a header do not automatically link function bodies.
- The caller should guess the function’s type.
A consistent declaration is needed for checking the interface.
- Share declarations through a header and include the implementation source in the build.
✓ Correct reasoning. The build must translate and connect the definitions the program requires.
C17
Connect this topic to other ideas
Chapters that build on this topic
46Arguments, conversion, and the environmentNo revision choice yet
Recall three ideas
- Command-line arguments are strings supplied through the hosted startup interface.
- Parsing a number and accepting an application value are separate checks.
- Borrowed environment strings have availability and invalidation rules.
Which checks would you use before accepting one command-line argument as a level from zero through 100?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- Yes, argv converts numeric-looking text automatically.
argv supplies strings; it does not perform numeric validation.
- No. Parse it and check the accepted syntax and range.
✓ Correct reasoning. Presence, conversion success, and acceptable value range are separate checks.
- Yes, argc records the numeric value of every argument.
argc counts arguments; it does not describe their numeric contents.
C17
Connect this topic to other ideas
47Variadic functions: arguments need an agreementNo revision choice yet
Recall three ideas
- Trailing variadic arguments need an explicit count and type agreement.
- Default argument promotions affect which type va_arg must retrieve.
- Each va_start or va_copy traversal needs the corresponding va_end.
Why does a float passed after the ellipsis need to be retrieved as double?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- float, with no change.
Default argument promotions apply to arguments corresponding to the ellipsis.
- double.
✓ Correct reasoning. The receiving variadic code must follow the promoted-type agreement, not retrieve it as float.
- A pointer to the caller’s float object.
This is a value conversion, not an implicit address-taking operation.
C17
Connect this topic to other ideas
Builds on
Chapters that build on this topic
This topic is a review or a deeper endpoint in this learning path.
48Searching and sorting by a comparison ruleNo revision choice yet
Recall three ideas
- A comparator supplies a consistent ordering through the sign of its result.
- qsort may reorder equal elements and does not promise a particular sorting algorithm.
- bsearch needs the required key-relative arrangement and may return any equal match.
What must stay consistent between sorting an array and searching it with a comparison callback?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- A comparator must always return exactly 1.
A comparison rule must distinguish less, equal, and greater with the required signs.
- All subtraction results are automatically Boolean.
Ordinary integer subtraction is not restricted to zero and one.
- Signed subtraction can overflow and fail to express a valid ordering.
✓ Correct reasoning. Use safe comparisons and a consistent ordering contract instead of relying on a potentially overflowing difference.
C17
Connect this topic to other ideas
Builds on
Chapters that build on this topic
This topic is a review or a deeper endpoint in this learning path.
49Streams, buffering, and EOFNo revision choice yet
Recall three ideas
- A stream is a C interface to a sequence, distinct from its underlying device.
- A read result must be checked before the program treats it as a character.
- Buffering, end-of-file indicators, and error indicators have separate meanings.
Why should a character read be stored in int and checked before narrowing it to char?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- Because int always stores exactly one visible letter.
The purpose is preserving the function’s return interface, not a universal letter representation.
- Premature conversion to char can lose information needed by the return-value check.
✓ Correct reasoning. Keep the return type and inspect the stream’s EOF/error state as the interface requires.
- EOF is an extra character stored at the end of every file.
EOF is an integer indicator used by the interface, not a required stored file character.
C17
Connect this topic to other ideas
Chapters that build on this topic
50Formatted output and format contractsNo revision choice yet
Recall three ideas
- Formats must match the supplied argument types after the relevant promotions.
- Width, precision, and destination capacity solve different formatting questions.
- Output errors and truncation must be checked under the chosen function’s rules.
What would you check after snprintf before treating its buffer as the complete requested message?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- Only how many characters the output should look like.
Appearance does not establish a valid argument type for a conversion.
- Only the variable’s name.
Identifier spelling does not communicate the argument’s required type.
- The actual argument type after the applicable argument promotions.
✓ Correct reasoning. The format string is a contract; it does not generally convert a mismatched argument into the required type.
C17
Connect this topic to other ideas
Chapters that build on this topic
51Formatted input: matching and limitsNo revision choice yet
Recall three ideas
- Formatted input can stop after a partial match or a failed conversion.
- Destination types and field widths must match the conversion contract and available storage.
- Numeric input whose converted value cannot be represented needs particular care with scanf-family rules.
Why is a successful first conversion insufficient evidence that the whole requested input record was accepted?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- An input conversion can fail before storing that result.
✓ Correct reasoning. Check the expected number of counted assignments before using the results; %n is excluded from that count.
- scanf always fills every destination with zero first.
A failed conversion does not promise to initialize the destination to zero.
- A width limit guarantees valid numeric range.
A field width limits consumed input; it is not a general numeric-range validation strategy.
C17
Connect this topic to other ideas
Chapters that build on this topic
52Lines, boundaries, and checked parsingNo revision choice yet
Recall three ideas
- A complete input record must be separated from chunks returned by an input call.
- Parsing should distinguish valid data, incomplete input, invalid text, and out-of-range values.
- Accepted values should be committed only after the required checks succeed.
How would you reject an overlong line while leaving the next input record ready to read?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- Yes, a terminating null proves the whole line fitted.
Null termination does not prove that a newline or the entire logical line was consumed.
- Yes, the buffer size automatically grows.
fgets does not dynamically enlarge the supplied buffer.
- No. The buffer can fill before the line ends.
✓ Correct reasoning. Detect and handle incomplete lines according to the input policy.
C17
Connect this topic to other ideas
53Opening files, modes, and lifetimesNo revision choice yet
Recall three ideas
- An opening mode chooses reading, creation, replacement, append, or update behavior.
- The opening operation can fail or modify a file before a later write.
- Stream ownership includes the appropriate close operation and its possible failure.
Which mode and failure policy would protect an existing file when the task requires creating a new destination?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- Whether the returned pointer is NULL.
✓ Correct reasoning. NULL indicates failure to open; using it as a valid stream would violate the interface contract.
- Whether the returned pointer equals EOF.
EOF is an integer macro used by other I/O interfaces, not fopen’s failure pointer.
- Only whether the filename contains a dot.
The filename’s appearance does not prove that opening succeeded.
C17
Connect this topic to other ideas
Chapters that build on this topic
54Block I/O, positions, and update streamsNo revision choice yet
Recall three ideas
- Block I/O reports complete transferred elements rather than a promise that the entire request succeeded.
- Position tokens and text-stream offsets follow specific stream rules.
- Update streams require the correct transitions between reading and writing.
What would you inspect after a short block read before deciding whether it is a final record or an error?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- The number of elements successfully written.
✓ Correct reasoning. The result counts elements. With an element size of one byte, it also directly gives the byte count.
- Always the total requested number of bytes.
The result reports completed elements and can be short.
- A guarantee that no later flush or close can fail.
Buffered output can encounter errors later; success here is not that broader guarantee.
C17
Connect this topic to other ideas
Builds on
Chapters that build on this topic
55Errors, status, errno, and assertionsNo revision choice yet
Recall three ideas
- Interfaces report failure through their documented status and result conventions.
- errno is meaningful only under the applicable operation’s error rules.
- Assertions express program assumptions and cannot replace validation that must run in every build.
Why is a nonzero errno after an unrelated successful operation insufficient evidence of a new failure?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- Yes, every successful function resets errno.
Successful functions do not generally promise to clear errno.
- Yes, errno replaces every function’s return value.
Each interface defines its own error indication and when errno is meaningful.
- No. Follow that function’s documented failure indication and errno rules.
✓ Correct reasoning. The value can be left over from an earlier operation.
C17
Connect this topic to other ideas
56Ownership, cleanup, and partial workNo revision choice yet
Recall three ideas
- Cleanup depends on which resources were successfully acquired before a failure.
- Ownership determines who must release each resource and when references become invalid.
- Closing resources does not automatically undo external partial work or prove durable storage.
Which resources and partial effects would you track if copying a file fails halfway through?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- Release every imagined resource, even those never acquired.
Cleanup must follow actual acquisition state and the resource’s API contract.
- Return immediately and leave the first resource owned by nobody.
Losing ownership can leak the first resource.
- Release or transfer the first resource according to the ownership contract.
✓ Correct reasoning. Partial work still creates cleanup obligations for resources already acquired.
C17
Connect this topic to other ideas
57Dates, clocks, and measuring timeNo revision choice yet
Recall three ideas
- Calendar time, elapsed duration, and processor time answer different questions.
- Calendar fields, conversions, and formatting have conventions and failure cases.
- Clock availability, resolution, range, and monotonicity must be checked separately.
Why might a program that waits for two seconds use much less than two seconds of processor time?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- Always the calendar date as Unix seconds.
Calendar time and the representation of time_t are separate from clock’s interface.
- Processor time used by the program, rather than a general wall-clock stopwatch.
✓ Correct reasoning. Check availability and convert using CLOCKS_PER_SEC under the interface’s limits.
- The number of source lines executed.
Source-line counts are not the quantity reported by this clock interface.
C17
Connect this topic to other ideas
Builds on
Chapters that build on this topic
This topic is a review or a deeper endpoint in this learning path.
58Behavior, guarantees, and undefined behaviorNo revision choice yet
Recall three ideas
- Undefined, unspecified, and implementation-defined behavior describe different language categories.
- A language-valid operation can still violate an application’s requirements.
- Observing one result cannot establish a guarantee that the language does not provide.
How would you decide whether two observed outputs show an allowed choice or an invalid operation?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- That the operation is portable.
One observed outcome cannot create a language guarantee.
- Only that this run produced that observation.
✓ Correct reasoning. The C standard imposes no requirements for undefined behavior; a successful-looking run does not validate the operation.
- That the compiler must warn every time.
A diagnostic is not required for every possible undefined behavior.
C17
Connect this topic to other ideas
59Evaluation order and side effectsNo revision choice yet
Recall three ideas
- Value computation and side effects can have ordering relationships beyond expression grouping.
- Specific operators and full-expression boundaries provide sequencing guarantees.
- Unsequenced conflicting accesses can produce undefined behavior rather than merely multiple possible results.
When two operations must happen in order, how could separate statements make that requirement clearer?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- Both operands always run, in either order.
The right operand is conditionally evaluated, after the left operand.
- The left operand is evaluated first; the right is evaluated only if the left is nonzero.
✓ Correct reasoning. The logical-AND operator provides short-circuit evaluation and sequencing.
- The right operand always runs first.
That reverses this operator’s required evaluation relationship.
C17
Connect this topic to other ideas
Chapters that build on this topic
60Effective types, aliases, and accessNo revision choice yet
Recall three ideas
- Typed access depends on the object, its lifetime, alignment, and the permitted access type.
- A character representation view does not grant arbitrary typed reinterpretation.
- restrict is a contract about the relevant accesses, not a generic synonym for “these pointers differ.”
Why can a buffer with enough bytes still be unsuitable for access through a converted typed pointer?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- A cast automatically creates a new object of the destination type.
Changing a pointer’s type does not generally create a new pointed-to object.
- A cast makes every possible access type valid.
The language restricts which types may access an object’s stored value.
- Lifetime, access-type rules, and bounds must also permit the operation.
✓ Correct reasoning. Character-type representation access does not grant unrestricted permission for arbitrary typed reads.
C17
Connect this topic to other ideas
61Portability and explicit assumptionsNo revision choice yet
Recall three ideas
- Portable design starts by stating which target properties the program needs.
- Language guarantees and implementation-specific choices must be kept distinct.
- Explicit conversions, width checks, and format definitions make assumptions reviewable.
Which assumptions would you document before sharing a two-octet numeric format between two machines?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- No. Exact-width typedefs are provided when the implementation has a suitable type.
✓ Correct reasoning. Do not assume an optional exact-width type exists without checking the implementation’s facilities.
- Yes, int is required to be exactly 32 bits.
C17 does not require a universal 32-bit int.
- Yes, including any header creates all integer widths.
A header cannot create an integer representation the implementation does not support.
C17
Connect this topic to other ideas
62Floating-point calculations and mathematical functionsNo revision choice yet
Recall three ideas
- Floating-point values have finite range and precision, with rounding under the selected implementation rules.
- Comparison tolerances must come from an application’s units, domain, and acceptable error.
- Math domains, special values, and error reporting require explicit policies.
Why could changing an addition order change a floating-point observation without proving the compiler is wrong?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- Yes, exceptions and math_errhandling never matter.
The implementation’s advertised error-handling facilities matter.
- Yes, every finite result proves there was no domain or range issue.
Inspect the relevant function and error contract instead of using that general shortcut.
- No. Follow math_errhandling and the relevant function’s result and error rules.
✓ Correct reasoning. Applicable errno and floating-point exception reporting must be handled according to the implementation’s contract.
C17
Connect this topic to other ideas
Builds on
Chapters that build on this topic
This topic is a review or a deeper endpoint in this learning path.
63Defensive C and security boundariesNo revision choice yet
Recall three ideas
- Validation includes semantic domains, resource limits, and checked size arithmetic.
- Pointer and count contracts still require genuinely accessible regions.
- Defensive choices reduce specified risks while remaining dependent on a clear threat and ownership model.
Which checks belong before calculating and allocating space for an input-controlled number of elements?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- Trust a claimed length without checking capacity.
A supplied length is input too; it can violate the receiving buffer’s bounds.
- Rename the buffer to make the operation safe.
Names can communicate intent but cannot enforce a valid copy.
- Validate the length, capacity, and arithmetic needed by the copy contract.
✓ Correct reasoning. If a C string is required, account for its terminator as part of that contract.
C17
Connect this topic to other ideas
64External data formats: an agreement about bytesNo revision choice yet
Recall three ideas
- An external format defines fields and encodings independently of a structure’s raw layout.
- Width, octet order, version, and length rules belong in the reader/writer agreement.
- Validate the complete record before committing results, and handle partial input explicitly.
Why is an exact expected-byte test useful in addition to an encoder/decoder round trip?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- No. Layout, padding, byte order, and representations still need an explicit format agreement.
✓ Correct reasoning. Define the fields and encoding, then serialize and validate them deliberately.
- Yes, binary mode standardizes every structure’s layout.
Binary mode does not impose a universal structure representation.
- Yes, sizeof alone describes the complete external protocol.
A local byte size does not specify the meanings or encoding of those bytes.
C17
Connect this topic to other ideas
Builds on
Chapters that build on this topic
This topic is a review or a deeper endpoint in this learning path.
65Threads, atomics, and shared stateNo revision choice yet
Recall three ideas
- Shared mutable state needs the required access and ordering rules.
- Atomic operations do not automatically make a larger multi-step update a transaction.
- Synchronization, resource lifetimes, and API support must all fit the design.
Why does publishing a flag need an ordering agreement for the ordinary data associated with it?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- Yes, volatile is a thread lock.
volatile is not a mutex and does not by itself provide atomicity or synchronization.
- No. A suitable synchronization or atomic-access design is still needed.
✓ Correct reasoning. Conflicting unsynchronized non-atomic accesses can form a data race.
- Every access becomes an indivisible operation.
volatile does not generally turn ordinary operations into atomic operations.
C17
Connect this topic to other ideas
Builds on
Chapters that build on this topic
66Diagnostics, debugging, and evidenceNo revision choice yet
Recall three ideas
- A useful bug report makes a failure reproducible and states the expected behavior.
- Diagnostics, debugger observations, and sanitizers answer different questions.
- A regression check should exercise the boundary or assumption that caused the failure.
What evidence would let someone else investigate your failure without guessing your compiler options or input?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- No covered problem was reported in the executions exercised.
✓ Correct reasoning. This is useful evidence, but it is not proof for every input, path, or tool limitation.
- Every possible execution is valid C.
A finite test run does not explore every possible execution.
- The implementation no longer needs language rules.
Tools complement the language rules; they do not replace them.
General
Connect this topic to other ideas
Builds on
Chapters that build on this topic
67Style, contracts, and code reviewNo revision choice yet
Recall three ideas
- Readable names and interfaces make assumptions easier to inspect.
- Validation and state updates should have a deliberate, reviewable order.
- Style guidelines complement the language rules and the application contract.
Which naming or control-flow change would make a function’s rejection path easier to review?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- Yes, formatting automatically releases resources.
Formatting does not perform runtime cleanup.
- No. They help communicate a contract that still needs to be designed and followed.
✓ Correct reasoning. Readable code makes reasoning easier without making every operation correct automatically.
- Yes, a descriptive pointer name proves its lifetime.
A name is not evidence that an object is still alive.
General
Connect this topic to other ideas
Chapters that build on this topic
68C’s timeline: history, editions, and standardsNo revision choice yet
Recall three ideas
- C’s published editions and working drafts have different status.
- A nickname such as C23 can differ from the ISO publication year.
- An older resource should be interpreted using its intended edition and current implementation support.
Which dates and version claims would you check before using a feature from an older book or a compiler preview mode?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- Every old convention is required by modern C.
Historical practice and a current language requirement are different things.
- Rules and available features can differ between editions.
✓ Correct reasoning. Check the example’s edition and assumptions before treating it as a portable rule.
- A publication date alone proves compiler support.
Implementation support must be checked separately from a standard’s publication.
General
Connect this topic to other ideas
Chapters that build on this topic
69Why C looks this way: design and tradeoffsNo revision choice yet
Recall three ideas
- C features connect practical systems needs with explicit language contracts.
- Efficiency and portability depend on program choices and implementation conditions.
- Understanding a tradeoff is more useful than treating compact syntax as a complete explanation.
Choose one C feature and explain both the problem it helps solve and the responsibility it leaves with the programmer.
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- Every invalid access is automatically rejected at runtime.
C does not promise a runtime check for every invalid operation.
- Pointer syntax removes the need to know bounds.
A pointer value does not generally carry a complete bounds contract.
- The program must respect bounds, lifetimes, and operation contracts.
✓ Correct reasoning. Direct control is useful when the program also maintains the conditions required for valid operations.
C17
Connect this topic to other ideas
Builds on
Chapters that build on this topic
70C’s influence: languages, runtimes, and interfacesNo revision choice yet
Recall three ideas
- Historical influence, similar syntax, implementation language, and foreign interfaces are different relationships.
- A runtime written in C does not give its language C semantics.
- Crossing a language boundary still needs compatible ABI, ownership, and lifetime contracts.
What different claims could someone mean when saying another language is based on C?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- No. Learn that language’s own type, lifetime, and operation rules.
✓ Correct reasoning. Syntax influence does not establish identical behavior.
- Yes, matching braces imply matching memory rules.
Braces alone do not define an entire language’s memory model.
- Yes, every language influenced by C has every C feature.
Influence can involve selected ideas rather than the whole language.
General
Connect this topic to other ideas
Chapters that build on this topic
This topic is a review or a deeper endpoint in this learning path.
71Modern C: C23 features and adoptionNo revision choice yet
Recall three ideas
- C23 adds language and library features with their own contracts.
- Compiler support, library support, and target availability are separate checks.
- New syntax does not remove bounds, lifetime, range, or argument-type requirements.
How would you verify a new C23 facility before depending on it in a program intended for several toolchains?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- Only that the source file ends in .c.
The extension alone establishes neither a language edition nor feature support.
- That one unrelated C23 example compiled.
Support for one feature does not prove support for every language and library change.
- The selected language mode and actual compiler/library support for the feature.
✓ Correct reasoning. Language editions and implementation support are distinct. Use documented support and a relevant feature check where appropriate.
C23 adoption
Connect this topic to other ideas
72Reading complete programs through their contractsNo revision choice yet
Recall three ideas
- A complete program joins several object, control-flow, and interface contracts.
- Success, rejection, and cleanup paths all contribute to the promised behavior.
- Boundary cases help test the reasoning without proving every possible execution.
Pick one complete example and explain what stays unchanged when it rejects invalid input.
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- Its input assumptions, boundaries, failures, and resource handling.
✓ Correct reasoning. An observed output is one piece of evidence about a larger contract.
- Only whether its variable names match another example.
Names alone do not establish equivalent behavior.
- Nothing; one output proves every execution.
Different inputs and paths can exercise different conditions.
General
Connect this topic to other ideas
73Carry the model forward: review and next stepsNo revision choice yet
Recall three ideas
- Use the reading path as a map connecting concepts rather than a one-time checklist.
- Explain a rule, its preconditions, and a boundary before generalising an observed result.
- Practice, reproducible questions, and learner feedback reveal where the explanation needs another step.
Which idea can you now explain more precisely, and which assumption would you check when applying it to a new program?
Check your reasoning about this idea
Optional. Answers are not saved or sent, and reading stays unrestricted.
Read the explanation for every choice
- Repeat its syntax without its validity conditions.
The conditions are part of understanding when the operation may be used.
- State what it does, why it helps, and which conditions keep it valid.
✓ Correct reasoning. Connecting meaning, purpose, and limits supports reasoning beyond a memorized example.
- Assume a compiler will prevent every mistake.
Compiler diagnostics do not cover every invalid operation or incorrect intention.
General
Connect this topic to other ideas
Chapters that build on this topic
This topic is a review or a deeper endpoint in this learning path.
Keep a copy of your revision choices
Export or restore revision choices here. Your notebook and reading-preferences backup remains in Reading settings. Import merges newer choices and preserves newer choices already in this browser.