<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>Snacks - modernc</title>
    <subtitle>Snack-size learning for a fast-paced world.</subtitle>
    <link rel="self" type="application/atom+xml" href="https://snacks.devtestonly.uk/tags/modernc/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://snacks.devtestonly.uk"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2026-09-27T00:00:00+00:00</updated>
    <id>https://snacks.devtestonly.uk/tags/modernc/atom.xml</id>
    <entry xml:lang="en">
        <title>Modern C: Basic values and data</title>
        <published>2026-09-27T00:00:00+00:00</published>
        <updated>2026-09-27T00:00:00+00:00</updated>
        
        <author>
          <name>someone</name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://snacks.devtestonly.uk/c/basic-values-and-data/"/>
        <id>https://snacks.devtestonly.uk/c/basic-values-and-data/</id>
        
        <content type="html" xml:base="https://snacks.devtestonly.uk/c/basic-values-and-data/">&lt;p&gt;Here is a detailed breakdown of the most important concepts and key takeaways from &lt;strong&gt;Chapter 5: Basic values and data&lt;/strong&gt; in Jens Gustedt’s &lt;em&gt;Modern C: A Guide to the C23 Standard&lt;/em&gt;.&lt;/p&gt;
&lt;h3 id=&quot;1-the-abstract-state-machine-section-5-1&quot;&gt;1. The Abstract State Machine (Section 5.1)&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Value-centric thinking:&lt;/strong&gt; C programs primarily reason about abstract mathematical values rather than concrete machine representations. All basic C values are either numbers or translate directly to numbers (e.g., characters, truth values, array positions).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Types determine behavior:&lt;/strong&gt; Every value has a statically determined type that dictates allowable operations, their results, and optimization opportunities.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The “As-if” Rule:&lt;/strong&gt; Compilers execute programs &lt;em&gt;as if&lt;/em&gt; strictly following the abstract state machine. The compiler is permitted to reorder or optimize instructions freely as long as observable behavior (e.g., stored state in addressable memory or I/O calls like &lt;code&gt;printf&lt;/code&gt;) remains identical.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;2-basic-types-section-5-2&quot;&gt;2. Basic Types (Section 5.2)&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Four Base Classes:&lt;/strong&gt; Base types belong to four fundamental classes: &lt;strong&gt;unsigned integers&lt;/strong&gt;, &lt;strong&gt;signed integers&lt;/strong&gt;, &lt;strong&gt;real floating-point numbers&lt;/strong&gt;, and &lt;strong&gt;complex floating-point numbers&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Integer Promotion for Narrow Types:&lt;/strong&gt; Narrow integer types (&lt;code&gt;bool&lt;/code&gt;, &lt;code&gt;char&lt;/code&gt;, &lt;code&gt;signed char&lt;/code&gt;, &lt;code&gt;unsigned char&lt;/code&gt;, &lt;code&gt;short&lt;/code&gt;, &lt;code&gt;unsigned short&lt;/code&gt;) cannot undergo arithmetic directly; they are automatically &lt;em&gt;promoted&lt;/em&gt; to &lt;code&gt;signed int&lt;/code&gt; prior to arithmetic calculations.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Type Choice Best Practices:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Use &lt;code&gt;size_t&lt;/code&gt; for object sizes, cardinalities, array indices, and ordinal numbers.&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;unsigned&lt;/code&gt; for small non-negative quantities.&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;signed&lt;/code&gt; for small quantities that require negative values, and &lt;code&gt;ptrdiff_t&lt;/code&gt; for signed pointer or index differences.&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;double&lt;/code&gt; for general floating-point calculations and &lt;code&gt;double complex&lt;/code&gt; for complex numbers.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;3-specifying-values-literals-section-5-3&quot;&gt;3. Specifying Values &amp;amp; Literals (Section 5.3)&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Numerical Literals are Positive:&lt;/strong&gt; Literal values are strictly non-negative. A minus sign in front of a literal (e.g., &lt;code&gt;-42&lt;/code&gt;) is a unary negation operator applied to a positive value, not part of the literal syntax itself.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Decimal Integer Literals:&lt;/strong&gt; Decimal literals default to the first signed integer type (&lt;code&gt;int&lt;/code&gt;, &lt;code&gt;long&lt;/code&gt;, &lt;code&gt;long long&lt;/code&gt;) into which the value fits.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;C23 Literals &amp;amp; Suffixes:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Supports binary literals starting with &lt;code&gt;0b&lt;/code&gt; or &lt;code&gt;0B&lt;/code&gt; (e.g., &lt;code&gt;0b1010&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Uses exact suffixes to force types: &lt;code&gt;u&lt;/code&gt;/&lt;code&gt;U&lt;/code&gt; for unsigned, &lt;code&gt;l&lt;/code&gt;/&lt;code&gt;L&lt;/code&gt; for long, &lt;code&gt;ll&lt;/code&gt;/&lt;code&gt;LL&lt;/code&gt; for long long, and C23’s &lt;code&gt;wb&lt;/code&gt;/&lt;code&gt;WB&lt;/code&gt; for bit-precise &lt;code&gt;_BitInt(N)&lt;/code&gt; literals.&lt;/li&gt;
&lt;li&gt;Floating-point constants default to &lt;code&gt;double&lt;/code&gt; unless given an &lt;code&gt;f&lt;/code&gt;/&lt;code&gt;F&lt;/code&gt; (&lt;code&gt;float&lt;/code&gt;) or &lt;code&gt;l&lt;/code&gt;/&lt;code&gt;L&lt;/code&gt; (&lt;code&gt;long double&lt;/code&gt;) suffix.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Complex Unit &lt;code&gt;I&lt;/code&gt;:&lt;/strong&gt; Includes the standard macro &lt;code&gt;I&lt;/code&gt; (from &lt;code&gt;&amp;lt;complex.h&amp;gt;&lt;/code&gt;) representing the imaginary unit \(\sqrt{-1}\).&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;4-implicit-conversions-section-5-4&quot;&gt;4. Implicit Conversions (Section 5.4)&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Avoid Narrowing Conversions:&lt;/strong&gt; Converting a value to a narrower type can silently lose information or trigger implementation-defined behavior.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Dangers of Mixed Signedness:&lt;/strong&gt; Operations combining signed and unsigned values force conversion to unsigned types. For example, the comparison &lt;code&gt;-1 &amp;lt; 0U&lt;/code&gt; evaluates to &lt;code&gt;false&lt;/code&gt; because &lt;code&gt;-1&lt;/code&gt; is converted to &lt;code&gt;UINT_MAX&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Type Consistency:&lt;/strong&gt; Design types across expressions so that implicit conversions remain completely harmless and predictable.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;5-initializers-section-5-5&quot;&gt;5. Initializers (Section 5.5)&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Initialize Everything:&lt;/strong&gt; All variables must be initialized upon definition to keep the abstract state machine in a valid, deterministic state.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;C23 Universal Default Initializer &lt;code&gt;{}&lt;/code&gt;:&lt;/strong&gt; The empty initializer &lt;code&gt;{}&lt;/code&gt; is valid for all object types (including aggregate types and variable-length arrays), zeroing out all memory/fields.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Designated Initializers:&lt;/strong&gt; Aggregate structures and arrays should use designated initializers (e.g., &lt;code&gt; = 1&lt;/code&gt; or &lt;code&gt;.member = val&lt;/code&gt;) for explicit and maintenance-safe initialization.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;6-named-constants-section-5-6&quot;&gt;6. Named Constants (Section 5.6)&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Distinguish Read-Only vs. Constants:&lt;/strong&gt; &lt;code&gt;const&lt;/code&gt;-qualified variables define read-only objects in memory, not true compile-time constants.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Enumerations (&lt;code&gt;enum&lt;/code&gt;):&lt;/strong&gt; Modern enumerations provide typed integer constants. C23 introduces fixed underlying type syntax for enumerations (e.g., &lt;code&gt;enum code : unsigned char&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;constexpr&lt;/code&gt; in C23:&lt;/strong&gt; Introduces true compile-time constant objects that are checked at compile time to ensure the initializer fits the declared type without value alteration.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;7-binary-representations-section-5-7&quot;&gt;7. Binary Representations (Section 5.7)&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Unsigned Integers:&lt;/strong&gt; Represented via modular arithmetic modulo \(2^p\) (where \(p\) is precision). Unsigned integer arithmetic is strictly well-defined and safely wraps around on overflow.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Signed Integers &amp;amp; Two’s Complement:&lt;/strong&gt; C23 strictly standardizes two’s complement signed integer representation. Overflow in signed arithmetic is &lt;strong&gt;undefined behavior&lt;/strong&gt; and must be avoided.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Bit Manipulation &amp;amp; Shifts:&lt;/strong&gt; Unsigned types should always be used for bitwise set operations (&lt;code&gt;&amp;amp;&lt;/code&gt;, &lt;code&gt;|&lt;/code&gt;, &lt;code&gt;^&lt;/code&gt;, &lt;code&gt;~&lt;/code&gt;) and shift operations (&lt;code&gt;&amp;lt;&amp;lt;&lt;/code&gt;, &lt;code&gt;&amp;gt;&amp;gt;&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Fixed-Width &amp;amp; Bit-Precise Integers:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Exact-width integers (&lt;code&gt;int32_t&lt;/code&gt;, &lt;code&gt;uint64_t&lt;/code&gt;) from &lt;code&gt;&amp;lt;stdint.h&amp;gt;&lt;/code&gt; provide guaranteed bit widths.&lt;/li&gt;
&lt;li&gt;C23 introduces bit-precise integers &lt;code&gt;_BitInt(N)&lt;/code&gt; and &lt;code&gt;unsigned _BitInt(N)&lt;/code&gt; for arbitrary bit widths.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Floating-Point Realities:&lt;/strong&gt; Floating-point operations represent real number approximations. They are non-associative, non-commutative, and &lt;strong&gt;must never be checked for exact equality (&lt;code&gt;==&lt;/code&gt;)&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Modern C: Expressing computations</title>
        <published>2026-09-27T00:00:00+00:00</published>
        <updated>2026-09-27T00:00:00+00:00</updated>
        
        <author>
          <name>someone</name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://snacks.devtestonly.uk/c/expressing-computations/"/>
        <id>https://snacks.devtestonly.uk/c/expressing-computations/</id>
        
        <content type="html" xml:base="https://snacks.devtestonly.uk/c/expressing-computations/">&lt;p&gt;Here is a detailed breakdown of the key takeaways and fundamental concepts from &lt;strong&gt;Chapter 4: Expressing computations&lt;/strong&gt; in Jens Gustedt’s &lt;em&gt;Modern C: A Guide to the C23 Standard&lt;/em&gt;.&lt;/p&gt;
&lt;h3 id=&quot;1-operands-and-operators-section-4-1&quot;&gt;1. Operands and Operators (Section 4.1)&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Value vs. Object distinction:&lt;/strong&gt; In C computations, &lt;strong&gt;operators&lt;/strong&gt; (e.g., &lt;code&gt;+&lt;/code&gt;, &lt;code&gt;!=&lt;/code&gt;) act upon &lt;strong&gt;operands&lt;/strong&gt; (values or objects). A value is a mathematical quantity, while an object is a named memory location holding a value.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Types of Operators:&lt;/strong&gt; The C standard distinguishes three operator categories: &lt;strong&gt;value operators&lt;/strong&gt; (compute new values), &lt;strong&gt;object operators&lt;/strong&gt; (modify or inspect stored objects), and &lt;strong&gt;type operators&lt;/strong&gt; (&lt;code&gt;sizeof&lt;/code&gt;, &lt;code&gt;alignof&lt;/code&gt;, &lt;code&gt;offsetof&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Bounded Non-Negative Integers:&lt;/strong&gt; The fundamental unsigned type &lt;code&gt;size_t&lt;/code&gt; represents non-negative quantities up to a platform-defined upper bound &lt;code&gt;SIZE_MAX&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;2-arithmetic-and-modular-rules-section-4-2&quot;&gt;2. Arithmetic and Modular Rules (Section 4.2)&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Unsigned Arithmetic is Always Well-Defined:&lt;/strong&gt; Unsigned integer operations (&lt;code&gt;+&lt;/code&gt;, &lt;code&gt;-&lt;/code&gt;, &lt;code&gt;*&lt;/code&gt;) never generate undefined behavior on their own. As long as the mathematical result fits in &lt;code&gt;[0, SIZE_MAX]&lt;/code&gt;, the result is exact.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Modular Wrap-Around:&lt;/strong&gt; Arithmetic on &lt;code&gt;size_t&lt;/code&gt; implicitly operates &lt;strong&gt;modulo \(\text{SIZE_MAX} + 1\)&lt;/strong&gt;. When an operation overflows, it safely wraps around (e.g., &lt;code&gt;SIZE_MAX + 1&lt;/code&gt; wraps to &lt;code&gt;0&lt;/code&gt;, and &lt;code&gt;0 - 1&lt;/code&gt; evaluates to &lt;code&gt;SIZE_MAX&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Integer Division and Remainder:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;For unsigned integers, division &lt;code&gt;/&lt;/code&gt; (quotient) and remainder &lt;code&gt;%&lt;/code&gt; satisfy: \(\text{a} == (\text{a} / \text{b}) * \text{b} + (\text{a} % \text{b})\).&lt;/li&gt;
&lt;li&gt;Both &lt;code&gt;/&lt;/code&gt; and &lt;code&gt;%&lt;/code&gt; can &lt;strong&gt;never overflow&lt;/strong&gt;, and their outputs are always smaller than or equal to the inputs.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Division by Zero is strictly forbidden&lt;/strong&gt; and results in runtime failure.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;3-operators-that-modify-objects-side-effects-section-4-3&quot;&gt;3. Operators That Modify Objects &amp;amp; Side Effects (Section 4.3)&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Assignment Operators:&lt;/strong&gt; In assignments (&lt;code&gt;a = 42&lt;/code&gt; or &lt;code&gt;+=&lt;/code&gt;, &lt;code&gt;-=&lt;/code&gt;, &lt;code&gt;*=&lt;/code&gt;, &lt;code&gt;/=&lt;/code&gt;, &lt;code&gt;%=&lt;/code&gt;), the left side must be an addressable object (lvalue), and the right side is a value (rvalue).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Prefix vs. Postfix Modifications:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Prefix&lt;/strong&gt; (&lt;code&gt;++a&lt;/code&gt;, &lt;code&gt;--a&lt;/code&gt;) modifies the object first and yields the &lt;strong&gt;new&lt;/strong&gt; value to the surrounding expression.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Postfix&lt;/strong&gt; (&lt;code&gt;a++&lt;/code&gt;, &lt;code&gt;a--&lt;/code&gt;) modifies the object but yields the &lt;strong&gt;original&lt;/strong&gt; value prior to modification.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Golden Rules for Clean Code:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;“Side effects in value expressions are evil.”&lt;/strong&gt; Avoid embedding variable modifications inside complex arithmetic.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;“Never modify more than one object in a single statement.”&lt;/strong&gt; Combining multiple object modifications in one statement obscures control flow and causes bugs.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;4-boolean-context-comparisons-logic-section-4-4&quot;&gt;4. Boolean Context: Comparisons &amp;amp; Logic (Section 4.4)&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Truth Values as Arithmetic Integers:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Comparison (&lt;code&gt;==&lt;/code&gt;, &lt;code&gt;!=&lt;/code&gt;, &lt;code&gt;&amp;lt;&lt;/code&gt;, &lt;code&gt;&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;=&lt;/code&gt;, &lt;code&gt;&amp;gt;=&lt;/code&gt;) and logic (&lt;code&gt;!&lt;/code&gt;, &lt;code&gt;&amp;amp;&amp;amp;&lt;/code&gt;, &lt;code&gt;||&lt;/code&gt;) operators strictly return &lt;code&gt;false&lt;/code&gt; (&lt;code&gt;0&lt;/code&gt;) or &lt;code&gt;true&lt;/code&gt; (&lt;code&gt;1&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Because &lt;code&gt;false&lt;/code&gt; and &lt;code&gt;true&lt;/code&gt; are numeric (&lt;code&gt;0&lt;/code&gt; and &lt;code&gt;1&lt;/code&gt;), these boolean results can be directly used as arithmetic terms or array indices.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Short-Circuit Evaluation:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Logical AND (&lt;code&gt;&amp;amp;&amp;amp;&lt;/code&gt;) and logical OR (&lt;code&gt;||&lt;/code&gt;) evaluate left-to-right and &lt;strong&gt;skip evaluation of the second operand&lt;/strong&gt; if the first operand fully determines the result.&lt;/li&gt;
&lt;li&gt;For instance, &lt;code&gt;if (b != 0 &amp;amp;&amp;amp; (a / b &amp;gt; 1))&lt;/code&gt; safely avoids division by zero because &lt;code&gt;(a / b)&lt;/code&gt; is evaluated only when &lt;code&gt;b != 0&lt;/code&gt; is true.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;5-the-ternary-operator-section-4-5&quot;&gt;5. The Ternary Operator (Section 4.5)&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Conditional Expressions:&lt;/strong&gt; The ternary operator &lt;code&gt;cond ? A : B&lt;/code&gt; evaluates &lt;code&gt;cond&lt;/code&gt; first, then evaluates &lt;strong&gt;only one&lt;/strong&gt; of the two branches (&lt;code&gt;A&lt;/code&gt; or &lt;code&gt;B&lt;/code&gt;) based on whether &lt;code&gt;cond&lt;/code&gt; is true or false.&lt;/li&gt;
&lt;li&gt;Unlike an &lt;code&gt;if&lt;/code&gt; statement, the ternary operator is an expression that yields a value, making it suitable for clean return statements or inline initializations (e.g., &lt;code&gt;return (a &amp;lt; b) ? a : b;&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;6-evaluation-order-and-sequencing-section-4-6&quot;&gt;6. Evaluation Order and Sequencing (Section 4.6)&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Sequenced vs. Unsequenced Operators:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Only four operators strictly sequence their operands from left to right: &lt;code&gt;&amp;amp;&amp;amp;&lt;/code&gt;, &lt;code&gt;||&lt;/code&gt;, &lt;code&gt;?:&lt;/code&gt;, and the comma operator &lt;code&gt;,&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Most operators do not sequence their operands.&lt;/strong&gt; In &lt;code&gt;f(a) + g(b)&lt;/code&gt;, the compiler may evaluate &lt;code&gt;f(a)&lt;/code&gt; or &lt;code&gt;g(b)&lt;/code&gt; in any arbitrary order.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Function Arguments are Unsequenced:&lt;/strong&gt; Function argument lists do not guarantee an evaluation order (e.g., in &lt;code&gt;printf(&quot;%g %g&quot;, f(a), f(b))&lt;/code&gt;, either function may run first).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Banning Side Effects in Function Expressions:&lt;/strong&gt; Because operand evaluation order is non-deterministic across compilers, function calls placed within expressions &lt;strong&gt;must never rely on side effects&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The Comma Operator Trap:&lt;/strong&gt; Avoid using the comma operator &lt;code&gt;,&lt;/code&gt; in value expressions. For example, &lt;code&gt;A[i, j]&lt;/code&gt; is not a 2D matrix index in C; it evaluates &lt;code&gt;i&lt;/code&gt;, discards it, and indexes &lt;code&gt;A[j]&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
</content>
        
    </entry>
</feed>
