YOUR C LEARNING COMPANION

Find your next idea.

PAUSE & CONNECT

Test the idea.
Understand the reason.

73 optional concept checks, with an explanation for every choice. Explore without scores, timers, or reading gates.

73 topics

What is programming?General

Optional. Answers are not saved or sent, and reading stays unrestricted.

Why does a program need precise instructions?
Read the explanation for every choice
  1. 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.

  2. The computer always guesses the programmer’s intention.

    A programmer’s intended meaning does not replace the language’s rules.

  3. Precise instructions make every program correct.

    Precision helps express a plan, but the plan can still contain a mistake.

General

Read the chapter
How computers follow instructionsGeneral

Optional. Answers are not saved or sent, and reading stays unrestricted.

Must one C source line correspond to exactly one machine instruction?
Read the explanation for every choice
  1. Yes, line breaks define processor operations.

    Source layout does not establish a one-to-one instruction count.

  2. Yes, comments each require a machine instruction.

    Comments are not runtime instructions.

  3. No. Translation and optimization can produce a different arrangement.

    ✓ Correct reasoning. Reason from language semantics before assuming a particular machine-level trace.

General

Read the chapter
CPU, memory, storage, and the operating systemGeneral

Optional. Answers are not saved or sent, and reading stays unrestricted.

Which distinction helps explain why unsaved work can disappear?
Read the explanation for every choice
  1. RAM and persistent storage are interchangeable.

    Working memory and persistent storage have different roles and persistence properties.

  2. 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.

  3. A CPU permanently saves every intermediate value.

    Executing operations does not automatically create a persistent copy of every value.

General

Read the chapter
Why programming languages existGeneral

Optional. Answers are not saved or sent, and reading stays unrestricted.

Can syntactically valid code still implement the wrong plan?
Read the explanation for every choice
  1. Yes. Following the grammar does not prove the intended logic.

    ✓ Correct reasoning. Syntax, language meaning, and the problem’s requirements are different questions.

  2. No, grammar checks every real-world requirement.

    A parser does not know every intended requirement.

  3. No, accepted code must produce the intended answer for all inputs.

    Acceptance alone is not that correctness guarantee.

General

Read the chapter
Why C was createdGeneral

Optional. Answers are not saved or sent, and reading stays unrestricted.

Which practical need helped shape C’s early development?
Read the explanation for every choice
  1. Implementing systems software, including Unix.

    ✓ Correct reasoning. C developed alongside Unix and grew from earlier systems-language work.

  2. Guaranteeing that every program works unchanged on every machine.

    C’s history does not remove a program’s implementation and environment assumptions.

  3. Replacing every machine-specific operation with automatic safety checks.

    C still requires explicit attention to bounds, lifetimes, and interfaces.

General

Read the chapter
From source code to a running programC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

A function was declared but its definition is missing from the build. What does the declaration provide?
Read the explanation for every choice
  1. The complete executable body.

    A declaration describes the function’s interface; its body is a definition.

  2. A guarantee that linking succeeds.

    The build still needs the definitions required by the program.

  3. 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

Read the chapter
Variables, values, and typesC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

After int saved = apples;, a later assignment changes apples. What happens to saved?
Read the explanation for every choice
  1. saved automatically follows apples.

    The initializer copied an int value; it did not create a live connection between the objects.

  2. 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.

  3. saved ceases to exist.

    An assignment to apples does not end saved’s lifetime.

C17

Read the chapter
Data types, ranges, and representationsC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

What can portable C code assume about sizeof(char)?
Read the explanation for every choice
  1. It is always 8.

    Eight is a common number of bits in a byte, not the value of sizeof(char).

  2. It equals sizeof(int) on every implementation.

    The standard does not require those two sizes to be equal.

  3. 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

Read the chapter
Declarations, initialization, and assignmentC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

How does initialization differ from a later assignment?
Read the explanation for every choice
  1. 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.

  2. Assignment creates a new variable name every time.

    Assigning to an existing object does not introduce a new identifier.

  3. Every local declaration initializes an int to zero.

    An ordinary automatic int without an initializer does not receive an implicit zero value.

C17

Read the chapter
Reading C: tokens, expressions, and statementsC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

Why are = and == different tokens?
Read the explanation for every choice
  1. 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.

  2. Whitespace decides whether both mean assignment.

    Whitespace does not make these two operators interchangeable.

  3. The compiler chooses their meaning from the programmer’s intention.

    The language’s token and expression rules determine their roles.

C17

Read the chapter
Expressions and operators: meaning before precedenceC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

Does higher operator precedence guarantee earlier evaluation of an operand?
Read the explanation for every choice
  1. Yes, precedence is a timeline.

    Precedence groups expressions; evaluation order is a separate set of rules.

  2. No. Grouping and evaluation order are separate rules.

    ✓ Correct reasoning. Parentheses and precedence help determine expression structure; sequencing rules determine required ordering.

  3. Adding parentheses always fixes unsequenced side effects.

    Grouping alone does not introduce sequencing where the language does not specify it.

C17

Read the chapter
Conditions, choices, and loopsC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

Why can a while loop execute its body zero times?
Read the explanation for every choice
  1. while always runs once before checking.

    That is not while’s control rule; its condition is checked before entering the body.

  2. The compiler removes every loop.

    Loop behavior follows the program’s semantics, not a universal removal rule.

  3. Its controlling expression can be false at the first check.

    ✓ Correct reasoning. A false initial condition prevents the first body execution.

C17

Read the chapter
Functions: inputs, results, and contractsC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

Does passing a pointer argument change C into pass-by-reference?
Read the explanation for every choice
  1. 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.

  2. 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.

  3. A pointer argument copies the whole pointed-to allocation.

    Copying a pointer value does not copy the objects it refers to.

C17

Read the chapter
Recursion: following separate callsC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

Does merely writing a base-case branch guarantee recursive calls will finish?
Read the explanation for every choice
  1. Yes, the presence of the branch forces every call to reach it.

    A branch that is never reached cannot stop the recursion.

  2. Yes, C guarantees unlimited call depth.

    Resource use and call depth are not unlimited portable guarantees.

  3. 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

Read the chapter
Comments: explaining intent in CC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

Outside literals, why can int/**/count; declare count?
Read the explanation for every choice
  1. The comment is replaced by whitespace, separating the tokens.

    ✓ Correct reasoning. It does not join int and count into a single identifier.

  2. The comment executes before the declaration.

    Comments are handled during translation, not executed as runtime statements.

  3. The characters become the identifier intcount.

    Comment replacement supplies separation instead of concatenating these tokens.

C17

Read the chapter
Qualifiers: read-only access and observable effectsC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

Does accessing a modifiable object through const int * make the original object globally immutable?
Read the explanation for every choice
  1. 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.

  2. Yes, every alias becomes read-only automatically.

    Qualifying one access path does not rewrite all other pointer objects and types.

  3. 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

Read the chapter
Storage classes: duration, scope, and linkageC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

For a file-scope definition static int count;, which properties apply?
Read the explanation for every choice
  1. Static storage duration and internal linkage.

    ✓ Correct reasoning. These describe object duration and identifier linkage; the name is declared at file scope.

  2. Automatic duration limited to one function call.

    A file-scope object does not have ordinary automatic duration.

  3. A fresh dynamic allocation whenever the name is used.

    Referencing the name does not perform a new allocation.

C17

Read the chapter
Constants, constant expressions, and compile-time checksC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

In C17, does const int n = 3; alone make n an integer constant expression?
Read the explanation for every choice
  1. Yes, const has the same role as every compile-time constant facility.

    Read-only qualification and integer-constant-expression rules are different concepts.

  2. 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.

  3. 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

Read the chapter
Reading keywords by the job they doC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

What is the main job of return in a function?
Read the explanation for every choice
  1. Always terminate the entire program immediately.

    Returning from an ordinary called function normally resumes its caller.

  2. Repeat the function body.

    return ends the current invocation rather than starting another iteration.

  3. 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

Read the chapter
C keyword index: C17 and C23C17

Optional. Answers are not saved or sent, and reading stays unrestricted.

Is printf a C language keyword?
Read the explanation for every choice
  1. Yes, every standard library name is a keyword.

    Library identifiers and language keywords are separate categories.

  2. 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.

  3. It becomes a keyword only after its first call.

    Calling a function does not change the lexical category of its identifier.

C17

Read the chapter
Objects and memoryC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

Does C require all ordinary local objects to occupy a physical stack?
Read the explanation for every choice
  1. Yes, a fixed stack layout is part of every C object’s type.

    A type does not prescribe a universal machine stack layout.

  2. 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.

  3. No local object can be optimized.

    Implementations can optimize while preserving required program behavior.

C17

Read the chapter
Scope, lifetime, and storage durationC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

An inner block has ended. What happens to a static local declared inside it?
Read the explanation for every choice
  1. Its object remains alive, while that name is outside its block scope here.

    ✓ Correct reasoning. Static storage duration and block scope answer different questions.

  2. Its object must be destroyed at block exit.

    That describes ordinary automatic storage, not a static local’s storage duration.

  3. Its name becomes globally visible.

    Static storage duration does not turn a block-scope identifier into a file-scope identifier.

C17

Read the chapter
Understanding pointersC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

After q = p;, p is redirected to another live object. What happens to q?
Read the explanation for every choice
  1. q automatically follows the new p.

    The assignment copied a pointer value, not an ongoing dependency on p.

  2. 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.

  3. The old target is freed automatically.

    Redirecting a pointer does not itself release the old target’s storage.

C17

Read the chapter
Understanding arraysC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

An array has three elements. What is its last valid element index?
Read the explanation for every choice
  1. 3

    Indices begin at zero, so index 3 would be outside the three elements.

  2. It depends on the first stored value.

    Element values do not change the indexing range.

  3. 2

    ✓ Correct reasoning. The element indices are 0, 1, and 2.

C17

Read the chapter
Arrays and pointers togetherC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

For int a[3], what is permitted for the pointer a + 3?
Read the explanation for every choice
  1. 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.

  2. Read *(a + 3) because the pointer can be formed.

    Being allowed to form a pointer does not make every dereference valid.

  3. It necessarily points to another object.

    C provides no guarantee of another usable object at that boundary.

C17

Read the chapter
Characters, buffers, and stringsC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

char text[6] = "cat"; What are its capacity and strlen result?
Read the explanation for every choice
  1. Capacity 3, length 6.

    This reverses the array’s element count and the character count before the first null.

  2. Capacity 6, length 3.

    ✓ Correct reasoning. The array has six elements; strlen excludes the terminating null and stops before it.

  3. Capacity 6, length 6.

    Extra zero-initialized elements do not extend the string past its first null.

C17

Read the chapter
Text, Unicode, UTF-8, and localeC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

For a valid null-terminated UTF-8 string in an 8-bit-byte char buffer, does strlen count visible letters?
Read the explanation for every choice
  1. 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.

  2. Yes, every visible letter is exactly one C char.

    That is not a general Unicode or UTF-8 guarantee.

  3. It automatically decodes and normalizes all Unicode text.

    strlen searches for the terminating null; it is not a Unicode normalization operation.

C17

Read the chapter
Dynamic memory and ownershipC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

For a positive requested size, realloc fails and returns NULL. What remains valid?
Read the explanation for every choice
  1. The old allocation has always been freed.

    For this positive-size failure, the old allocation is not deallocated.

  2. The new third element is ready to use.

    A failed growth request did not create that extra space.

  3. 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

Read the chapter
Understanding memory mistakesC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

Does assigning NULL to one pointer repair every alias after free?
Read the explanation for every choice
  1. 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.

  2. Yes, free finds and clears all aliases.

    free releases allocated storage; it does not locate and rewrite all pointer objects.

  3. Yes, NULL releases the same allocation again.

    Assigning NULL is an assignment, not another deallocation operation.

C17

Read the chapter
Structures: related dataC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

What happens to a pointer member during ordinary structure assignment?
Read the explanation for every choice
  1. Its entire pointed-to allocation is duplicated automatically.

    Structure assignment does not provide an automatic deep-copy ownership policy.

  2. 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.

  3. The original allocation is released.

    Assigning a structure does not itself call free on pointer members.

C17

Read the chapter
Structure values and functionsC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

A function receives a structure by value. Which change can affect an object shared with its caller?
Read the explanation for every choice
  1. Assigning a new integer directly to the copied structure’s int member.

    That member belongs to the separate parameter object.

  2. 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.

  3. Changing any parameter necessarily replaces the caller’s whole structure.

    The structure parameter is a separate object.

C17

Read the chapter
Enumerations: named choicesC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

With enum State { IDLE = 2, BUSY = 7 };, must BUSY have value 3?
Read the explanation for every choice
  1. Yes, an enum ignores explicitly supplied values.

    Explicit enumerator initializers are meaningful.

  2. Its value changes each time it is read.

    An enumerator is a named integer constant, not a runtime counter.

  3. No. BUSY is explicitly given the value 7.

    ✓ Correct reasoning. Sequential defaults do not override an explicit initializer.

C17

Read the chapter
Unions and tagged dataC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

In a tagged-union design, who keeps the tag consistent with the intended payload?
Read the explanation for every choice
  1. The program, through its construction and access contract.

    ✓ Correct reasoning. Assigning a union member does not automatically update a separate tag field.

  2. The union updates every separate tag automatically.

    C provides no such automatic relationship for an ordinary separate tag field.

  3. No tag is needed because every union member has separate storage.

    Union members share storage; the intended interpretation needs a clear contract.

C17

Read the chapter
Initializing records and aggregatesC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

In int a[3] = {1};, how are the remaining two elements initialized?
Read the explanation for every choice
  1. They both repeat 1.

    A partial initializer does not repeat the last explicitly supplied value.

  2. They are initialized to zero.

    ✓ Correct reasoning. The remaining aggregate elements receive the implicit initialization specified by the language.

  3. They must contain arbitrary uninitialized values.

    This aggregate has an initializer; its omitted elements are not treated like an uninitialized automatic int.

C17

Read the chapter
Padding, alignment, and layoutC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

Do equal meaningful structure-member values guarantee identical object bytes?
Read the explanation for every choice
  1. Yes, every structure contains only its meaningful values and no padding.

    Implementations can insert padding, and representations need not provide this general guarantee.

  2. No. Padding and representations can make byte comparison unsuitable for value equality.

    ✓ Correct reasoning. Compare meaningful members according to the equality your program intends.

  3. memcmp always performs a member-by-member semantic comparison.

    memcmp compares bytes, not the meanings of structure members.

C17

Read the chapter
Flexible array membersC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

Does setting a count field allocate space for a flexible array member?
Read the explanation for every choice
  1. Yes, the array grows automatically to match the count.

    A count assignment does not acquire storage.

  2. Yes, sizeof the header always includes any desired payload.

    The type’s fixed size does not supply arbitrary extra payload capacity.

  3. 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

Read the chapter
Types, declarations, and data interfacesC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

In int *a, b;, which declarator declares a pointer?
Read the explanation for every choice
  1. Both a and b.

    The star belongs to a’s declarator, not automatically to every name in the declaration.

  2. Only b.

    The star is attached to a’s declarator.

  3. Only a; b has type int.

    ✓ Correct reasoning. Read each declarator separately with the shared type specifier.

C17

Read the chapter
Function pointers and callbacksC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

Can a cast alone repair a callback whose function type is incompatible with the required callback type?
Read the explanation for every choice
  1. No. The eventual call must use a compatible function type.

    ✓ Correct reasoning. A cast does not change the function’s parameter and return contract.

  2. Yes, casting rewrites the function’s parameter types.

    Converting a pointer does not rewrite the function’s definition.

  3. Yes, every pointer type has identical call semantics.

    Object and function pointer roles and compatible function types still matter.

C17

Read the chapter
Preprocessing: preparing the sourceC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

How does #if differ from an ordinary if?
Read the explanation for every choice
  1. Both select runtime branches in the same way.

    #if is handled during preprocessing rather than as an ordinary runtime statement.

  2. #if selects source during preprocessing; if selects a path in ordinary execution.

    ✓ Correct reasoning. Conditional inclusion determines which source tokens proceed into later translation.

  3. #if can inspect every runtime variable’s current value.

    Preprocessing condition rules do not provide access to future runtime object values.

C17

Read the chapter
Macros: tokens, arguments, and pitfallsC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

A macro uses its parameter twice. Why can a side-effecting argument be risky?
Read the explanation for every choice
  1. Macro arguments are always evaluated exactly once.

    Token substitution does not provide a function-call-style single evaluation guarantee.

  2. 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.

  3. Parentheses automatically remove every repeated side effect.

    Parentheses can improve grouping without removing duplicated evaluations.

C17

Read the chapter
Headers: sharing an interfaceC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

Why place shared function declarations in a header?
Read the explanation for every choice
  1. Including a header always links a library.

    Header inclusion and supplying compiled definitions are separate build concerns.

  2. A header is a separate running program.

    Headers supply source through inclusion; they do not run as independent programs.

  3. 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

Read the chapter
Translation units and linkageC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

Do two file-scope static objects in different translation units have to be the same object because their names match?
Read the explanation for every choice
  1. 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.

  2. Yes, every matching spelling names one global object.

    Scope and linkage rules matter; matching text alone is insufficient.

  3. static always means block scope.

    static can appear in file-scope declarations too; scope depends on declaration location.

C17

Read the chapter
Linking and librariesC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

What is the difference between seeing a library declaration and supplying its definition?
Read the explanation for every choice
  1. 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.

  2. Including a header always builds every library on the computer.

    Header inclusion supplies source declarations, not a universal library-build operation.

  3. Every C implementation requires the same library command-line flags.

    Toolchain flags are implementation-specific interfaces.

C17

Read the chapter
The standard library: facilities and contractsC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

Does a valid library declaration make every call valid?
Read the explanation for every choice
  1. Yes, the library repairs all invalid pointers.

    A library interface does not remove the caller’s pointer and lifetime obligations.

  2. Yes, a header guarantees successful resource acquisition.

    Operations such as allocation and file opening can still fail.

  3. 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

Read the chapter
Modular programs: contracts and buildsC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

In an ordinary two-file module build, how are an interface and its implementation supplied?
Read the explanation for every choice
  1. Including the interface header automatically supplies every definition.

    Declarations in a header do not automatically link function bodies.

  2. The caller should guess the function’s type.

    A consistent declaration is needed for checking the interface.

  3. 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

Read the chapter
Arguments, conversion, and the environmentC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

If a command-line argument exists, is it already a valid number?
Read the explanation for every choice
  1. Yes, argv converts numeric-looking text automatically.

    argv supplies strings; it does not perform numeric validation.

  2. No. Parse it and check the accepted syntax and range.

    ✓ Correct reasoning. Presence, conversion success, and acceptable value range are separate checks.

  3. Yes, argc records the numeric value of every argument.

    argc counts arguments; it does not describe their numeric contents.

C17

Read the chapter
Variadic functions: arguments need an agreementC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

A float value is passed through ... in a prototyped variadic call. What type does its default argument promotion supply?
Read the explanation for every choice
  1. float, with no change.

    Default argument promotions apply to arguments corresponding to the ellipsis.

  2. double.

    ✓ Correct reasoning. The receiving variadic code must follow the promoted-type agreement, not retrieve it as float.

  3. A pointer to the caller’s float object.

    This is a value conversion, not an implicit address-taking operation.

C17

Read the chapter
Searching and sorting by a comparison ruleC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

Why can return a - b; be a bad comparison rule for arbitrary int values?
Read the explanation for every choice
  1. A comparator must always return exactly 1.

    A comparison rule must distinguish less, equal, and greater with the required signs.

  2. All subtraction results are automatically Boolean.

    Ordinary integer subtraction is not restricted to zero and one.

  3. 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

Read the chapter
Streams, buffering, and EOFC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

Why retain fgetc’s result in int until checking EOF?
Read the explanation for every choice
  1. Because int always stores exactly one visible letter.

    The purpose is preserving the function’s return interface, not a universal letter representation.

  2. 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.

  3. 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

Read the chapter
Formatted output and format contractsC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

What must a printf conversion agree with?
Read the explanation for every choice
  1. Only how many characters the output should look like.

    Appearance does not establish a valid argument type for a conversion.

  2. Only the variable’s name.

    Identifier spelling does not communicate the argument’s required type.

  3. 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

Read the chapter
Formatted input: matching and limitsC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

Why check scanf’s return value before using the result of a counted conversion?
Read the explanation for every choice
  1. 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.

  2. scanf always fills every destination with zero first.

    A failed conversion does not promise to initialize the destination to zero.

  3. A width limit guarantees valid numeric range.

    A field width limits consumed input; it is not a general numeric-range validation strategy.

C17

Read the chapter
Lines, boundaries, and checked parsingC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

If fgets succeeds, must it have consumed one whole input line?
Read the explanation for every choice
  1. Yes, a terminating null proves the whole line fitted.

    Null termination does not prove that a newline or the entire logical line was consumed.

  2. Yes, the buffer size automatically grows.

    fgets does not dynamically enlarge the supplied buffer.

  3. No. The buffer can fill before the line ends.

    ✓ Correct reasoning. Detect and handle incomplete lines according to the input policy.

C17

Read the chapter
Opening files, modes, and lifetimesC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

What should you check after fopen before using the stream?
Read the explanation for every choice
  1. Whether the returned pointer is NULL.

    ✓ Correct reasoning. NULL indicates failure to open; using it as a valid stream would violate the interface contract.

  2. Whether the returned pointer equals EOF.

    EOF is an integer macro used by other I/O interfaces, not fopen’s failure pointer.

  3. Only whether the filename contains a dot.

    The filename’s appearance does not prove that opening succeeded.

C17

Read the chapter
Block I/O, positions, and update streamsC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

What does fwrite return when asked to write several elements?
Read the explanation for every choice
  1. 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.

  2. Always the total requested number of bytes.

    The result reports completed elements and can be short.

  3. A guarantee that no later flush or close can fail.

    Buffered output can encounter errors later; success here is not that broader guarantee.

C17

Read the chapter
Errors, status, errno, and assertionsC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

Does a nonzero errno alone prove the last function call failed?
Read the explanation for every choice
  1. Yes, every successful function resets errno.

    Successful functions do not generally promise to clear errno.

  2. Yes, errno replaces every function’s return value.

    Each interface defines its own error indication and when errno is meaningful.

  3. No. Follow that function’s documented failure indication and errno rules.

    ✓ Correct reasoning. The value can be left over from an earlier operation.

C17

Read the chapter
Ownership, cleanup, and partial workC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

A function acquires one resource, then acquiring a second fails. What should its failure path account for?
Read the explanation for every choice
  1. Release every imagined resource, even those never acquired.

    Cleanup must follow actual acquisition state and the resource’s API contract.

  2. Return immediately and leave the first resource owned by nobody.

    Losing ownership can leak the first resource.

  3. Release or transfer the first resource according to the ownership contract.

    ✓ Correct reasoning. Partial work still creates cleanup obligations for resources already acquired.

C17

Read the chapter
Dates, clocks, and measuring timeC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

What does clock() aim to measure?
Read the explanation for every choice
  1. Always the calendar date as Unix seconds.

    Calendar time and the representation of time_t are separate from clock’s interface.

  2. 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.

  3. The number of source lines executed.

    Source-line counts are not the quantity reported by this clock interface.

C17

Read the chapter
Behavior, guarantees, and undefined behaviorC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

A program with undefined behavior appeared to work once. What does that establish?
Read the explanation for every choice
  1. That the operation is portable.

    One observed outcome cannot create a language guarantee.

  2. 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.

  3. That the compiler must warn every time.

    A diagnostic is not required for every possible undefined behavior.

C17

Read the chapter
Evaluation order and side effectsC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

What ordering does left && right provide?
Read the explanation for every choice
  1. Both operands always run, in either order.

    The right operand is conditionally evaluated, after the left operand.

  2. 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.

  3. The right operand always runs first.

    That reverses this operator’s required evaluation relationship.

C17

Read the chapter
Effective types, aliases, and accessC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

Why is alignment alone insufficient to justify a dereference after a pointer cast?
Read the explanation for every choice
  1. 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.

  2. A cast makes every possible access type valid.

    The language restricts which types may access an object’s stored value.

  3. 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

Read the chapter
Portability and explicit assumptionsC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

Must every conforming C17 implementation provide uint32_t?
Read the explanation for every choice
  1. 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.

  2. Yes, int is required to be exactly 32 bits.

    C17 does not require a universal 32-bit int.

  3. Yes, including any header creates all integer widths.

    A header cannot create an integer representation the implementation does not support.

C17

Read the chapter
Floating-point calculations and mathematical functionsC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

Can portable code assume every math error is reported only through errno?
Read the explanation for every choice
  1. Yes, exceptions and math_errhandling never matter.

    The implementation’s advertised error-handling facilities matter.

  2. 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.

  3. 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

Read the chapter
Defensive C and security boundariesC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

What should happen before copying externally supplied data into a bounded buffer?
Read the explanation for every choice
  1. Trust a claimed length without checking capacity.

    A supplied length is input too; it can violate the receiving buffer’s bounds.

  2. Rename the buffer to make the operation safe.

    Names can communicate intent but cannot enforce a valid copy.

  3. 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

Read the chapter
External data formats: an agreement about bytesC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

Does binary file mode make a raw structure dump a portable exchange format?
Read the explanation for every choice
  1. 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.

  2. Yes, binary mode standardizes every structure’s layout.

    Binary mode does not impose a universal structure representation.

  3. Yes, sizeof alone describes the complete external protocol.

    A local byte size does not specify the meanings or encoding of those bytes.

C17

Read the chapter
Threads, atomics, and shared stateC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

Does volatile alone make conflicting shared accesses safe between C threads?
Read the explanation for every choice
  1. Yes, volatile is a thread lock.

    volatile is not a mutex and does not by itself provide atomicity or synchronization.

  2. No. A suitable synchronization or atomic-access design is still needed.

    ✓ Correct reasoning. Conflicting unsynchronized non-atomic accesses can form a data race.

  3. Every access becomes an indivisible operation.

    volatile does not generally turn ordinary operations into atomic operations.

C17

Read the chapter
Diagnostics, debugging, and evidenceGeneral

Optional. Answers are not saved or sent, and reading stays unrestricted.

What does a clean sanitizer run establish?
Read the explanation for every choice
  1. 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.

  2. Every possible execution is valid C.

    A finite test run does not explore every possible execution.

  3. The implementation no longer needs language rules.

    Tools complement the language rules; they do not replace them.

General

Read the chapter
Style, contracts, and code reviewGeneral

Optional. Answers are not saved or sent, and reading stays unrestricted.

Can clear naming and indentation replace an ownership contract?
Read the explanation for every choice
  1. Yes, formatting automatically releases resources.

    Formatting does not perform runtime cleanup.

  2. 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.

  3. Yes, a descriptive pointer name proves its lifetime.

    A name is not evidence that an object is still alive.

General

Read the chapter
C’s timeline: history, editions, and standardsGeneral

Optional. Answers are not saved or sent, and reading stays unrestricted.

Why identify the language edition when reading an old C example?
Read the explanation for every choice
  1. Every old convention is required by modern C.

    Historical practice and a current language requirement are different things.

  2. Rules and available features can differ between editions.

    ✓ Correct reasoning. Check the example’s edition and assumptions before treating it as a portable rule.

  3. A publication date alone proves compiler support.

    Implementation support must be checked separately from a standard’s publication.

General

Read the chapter
Why C looks this way: design and tradeoffsC17

Optional. Answers are not saved or sent, and reading stays unrestricted.

What responsibility accompanies C’s direct control of objects and storage?
Read the explanation for every choice
  1. Every invalid access is automatically rejected at runtime.

    C does not promise a runtime check for every invalid operation.

  2. Pointer syntax removes the need to know bounds.

    A pointer value does not generally carry a complete bounds contract.

  3. 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

Read the chapter
C’s influence: languages, runtimes, and interfacesGeneral

Optional. Answers are not saved or sent, and reading stays unrestricted.

If another language uses C-like syntax, should you assume identical C semantics?
Read the explanation for every choice
  1. No. Learn that language’s own type, lifetime, and operation rules.

    ✓ Correct reasoning. Syntax influence does not establish identical behavior.

  2. Yes, matching braces imply matching memory rules.

    Braces alone do not define an entire language’s memory model.

  3. Yes, every language influenced by C has every C feature.

    Influence can involve selected ideas rather than the whole language.

General

Read the chapter
Modern C: C23 features and adoptionC23 adoption

Optional. Answers are not saved or sent, and reading stays unrestricted.

Before relying on a C23 feature, what should you check?
Read the explanation for every choice
  1. Only that the source file ends in .c.

    The extension alone establishes neither a language edition nor feature support.

  2. That one unrelated C23 example compiled.

    Support for one feature does not prove support for every language and library change.

  3. 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

Read the chapter
Reading complete programs through their contractsGeneral

Optional. Answers are not saved or sent, and reading stays unrestricted.

A complete example produces its expected output once. What should you examine next?
Read the explanation for every choice
  1. Its input assumptions, boundaries, failures, and resource handling.

    ✓ Correct reasoning. An observed output is one piece of evidence about a larger contract.

  2. Only whether its variable names match another example.

    Names alone do not establish equivalent behavior.

  3. Nothing; one output proves every execution.

    Different inputs and paths can exercise different conditions.

General

Read the chapter
Carry the model forward: review and next stepsGeneral

Optional. Answers are not saved or sent, and reading stays unrestricted.

What is a useful way to explain a C operation you have learned?
Read the explanation for every choice
  1. Repeat its syntax without its validity conditions.

    The conditions are part of understanding when the operation may be used.

  2. 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.

  3. Assume a compiler will prevent every mistake.

    Compiler diagnostics do not cover every invalid operation or incorrect intention.

General

Read the chapter
Search all 73 chapters in both languages.EN + HG

Try “pointer”, “why int”, or “undefined behavior”.

Concepts connect. Follow your curiosity.↑ ↓ to explore · Enter to open
MAKE YOURSELF COMFORTABLE

Your reading space

Appearance

A clear canvas with balanced contrast.

Text size

100%
AA

Reading tools

Your data stays in this browser

Export a backup before changing browsers or replacing an older version of the reader.

YOUR PERSONAL MARGINS

My notebook

Saved on this device
A LITTLE CLARITY

The glossary

A starting meaning, then a chapter to go deeper.

A QUICK DEFINITION

A little clarity

Read the full explanation →

A thought worth keeping