Fact-checked by Grok 2 weeks ago

Comma operator

The comma operator, denoted by the comma (,), is a binary in programming languages such as C, C++, and that sequentially evaluates its from left to right, discards the value and type of all except the rightmost one, and returns the value, type, and value category of that final as the result of the expression. This enables the execution of multiple subexpressions where only one is expected, primarily for their side effects, such as assignments or calls, while ensuring ordered evaluation. It must be distinguished from the syntactic comma used as a in declarations, arguments, or literals, as the form requires explicit parentheses in ambiguous contexts to avoid errors. In C and C++, the comma operator has the lowest operator precedence and is left-associative, meaning chained expressions like a, b, c evaluate as (a, b), c, with the left operand fully completed—including all side effects—before the right operand begins, due to the introduced sequence point. The left operand may yield void, but the result type is determined solely by the right operand, which cannot itself be an unevaluated comma expression in certain contexts like constant initializers. Common applications include compactly sequencing operations in for loop updates, such as for (int i = 0, j = 10; i < j; i++, j--) to increment one variable while decrementing another, or embedding side-effect expressions in return statements. Overloading the comma operator in C++ is possible but does not guarantee sequencing of operands unless explicitly handled, differing from the built-in version. In JavaScript, the comma operator similarly processes operands left-to-right with the lowest precedence, often parenthesized to override surrounding operator priorities, and is frequently employed in for loops for multiple initializations or updates, like for (let i = 0, j = 9; i <= j; i++, j-- ) { ... }. It discards intermediate values, making it suitable for combining assignments or method invocations before yielding a final result, though care must be taken to avoid unintended loss of references, such as with this in object methods. As specified in the ECMAScript standard, the operator evaluates each subexpression fully and returns the value of the last one, aligning closely with its behavior in C-derived languages. While absent in languages like Java or Python, the comma operator's design promotes concise expression sequencing in imperative code, though its low visibility can lead to readability concerns in complex statements.

Fundamentals

Syntax

The comma operator in the C and C++ programming languages is a binary operator, denoted by the comma token ,, that syntactically combines two expressions into a single compound expression of the form expr1, expr2. According to the ISO C99 standard, the grammar production for an expression allows it to be either an assignment-expression or another expression followed by a comma and an assignment-expression, enabling the operator to chain multiple operands while maintaining its binary nature at each step. Both operands must be valid expressions that can undergo evaluation, where the left operand is treated as a void expression and the right operand determines the type and value category of the result. This operator parses as a sequence of expressions within broader expression contexts, whether parenthesized or not, such as in (a, b) for simple variable references or f(), g() for function calls, ensuring the comma functions as an operator rather than a mere separator. In non-parenthesized forms, it integrates directly into assignment statements or other expression positions, but parentheses are required in contexts like function argument lists to disambiguate it from separator usage, as in f(a, (t=3, t+2), c). The operator's evaluation proceeds from left to right, with a sequence point between operands to guarantee ordering, though this behavioral aspect is distinct from its syntactic form. Importantly, the comma operator is exclusively used in expression contexts and must be distinguished from syntactic commas employed as separators in declarations, such as int a, b;, where no sequencing or value-yielding occurs. In declarations or initializer lists, commas merely delineate multiple items without forming a compound expression, whereas the operator enforces a grammatical structure that yields a single expression value. This distinction prevents ambiguity in parsing, confining the operator to scenarios where sequential expression evaluation is intended within a unified syntactic unit.

Semantics

The comma operator in C evaluates its left operand first, treating it as a void expression such that its value is discarded after evaluation, including the completion of any side effects; a sequence point then ensures these effects are fully realized before the right operand is evaluated, after which the right operand's value becomes the result of the entire expression. This strict left-to-right evaluation order guarantees sequencing, making the operator useful for enforcing the timing of side effects, such as assignments or function calls, without relying on undefined behavior in other contexts. The type of the result matches that of the right operand exactly, including any unqualified non-lvalue type, though if the right operand yields void (e.g., from a function call returning void or a cast to void), the comma expression itself yields void while still performing the sequenced evaluations. In such void contexts, the operator maintains its sequencing role without producing a usable value, allowing the left operand—potentially also void—to execute for its effects alone. It was formalized and its semantics precisely defined in the ANSI C standard (X3.159-1989), specifically in section 3.3.17, where it is described as yielding the value and type of its right-hand operand following left-to-right evaluation with an intervening sequence point.

Precedence and Associativity

In C and C++, the comma operator possesses the lowest precedence among all operators, which ensures it binds more loosely than every other operator in compound expressions. This low ranking means that higher-precedence operators, such as arithmetic, relational, logical, and assignment operators, are evaluated first, with the comma operator serving primarily to sequence the evaluation of its operands without altering the tighter bindings of those higher operators. The comma operator exhibits left-to-right associativity, meaning that in a chain of comma-separated expressions like a, b, c, the grouping parses as (a, b), c. Despite this grouping, the overall evaluation proceeds strictly from left to right, first executing a, then b, and finally c, with the value of the entire expression being that of the rightmost operand (c in this case). This associativity aligns with the operator's role in enforcing a specific sequencing order while yielding the result of the final subexpression. This combination of low precedence and left-to-right associativity significantly influences how compound expressions are parsed, particularly when the comma operator interacts with assignment or other binary operators. For instance, in x = y, z, the expression groups as (x = y), z due to the higher precedence of assignment (level 3), evaluating x = y first, then z, and returning the value of z—leaving x assigned to y's value but the overall expression's result as z. In contrast, x = (y, z) explicitly groups the comma operands together, assigning the value of z to x after evaluating both y and z. Such distinctions highlight the comma operator's non-interference with higher-precedence operations, allowing it to embed sequencing within broader expressions without disrupting their structure. Programmers must exercise caution with the comma operator's low precedence and associativity to avoid unintended parsing, which can lead to subtle bugs in assignments, function calls, or conditional contexts. A common pitfall occurs in assignments like a[i] = b++, c, which parses as (a[i] = b++), c—incrementing b and assigning its original value to a[i], then evaluating c—but may surprise developers expecting a[i] to receive c's value if parentheses are omitted. Similarly, in function calls such as f(g(), h()), the comma's precedence ensures g() and h() are sequenced appropriately, but mixing with other low-precedence operators like assignment can yield unexpected groupings without explicit parenthesization, potentially causing side-effect ordering errors or incorrect values. To mitigate these risks, parentheses are recommended when combining the comma operator with operators of comparable or uncertain precedence interactions.

Applications

In Loops

The comma operator plays a key role in for loops by allowing multiple expressions to be evaluated sequentially within the initialization and update clauses, where typically only a single expression is permitted. In the initialization clause, particularly when declaring variables, the comma functions as a separator to initialize multiple variables with compatible types in a single declaration, as in for (int i = 0, j = 10; i < j; i++, j--); this leverages the declaration syntax to set up loop variables efficiently without separate statements. In contrast, when the initialization is an expression rather than a declaration, the comma operator itself sequences non-declarative actions, such as assigning values to existing variables. In the update clause, the comma operator is commonly used to combine variable modifications with other side-effect operations, enabling actions like i++, printf(".") to both increment a counter and produce output after each iteration; all subexpressions are evaluated left-to-right, ensuring ordered execution. This approach sequences the updates while adhering to the loop's structure, as the overall value of the update expression—determined by its rightmost subexpression—is discarded after execution. The primary benefit of employing the comma operator in these loop contexts is enhanced conciseness, as it permits multiple initializations or updates without introducing extraneous statements that could disrupt the loop's readability or require block scoping. It preserves the traditional for loop form while accommodating complex control logic involving several variables or actions. However, a limitation arises from the operator's semantics: every subexpression is fully evaluated for its side effects, but only the last one's value influences the comma expression's result, which has no bearing on loop termination since the condition clause operates independently; unintended side effects from earlier subexpressions could thus occur even if not directly needed for control flow. As with its general behavior, the evaluation follows a strict left-to-right order, introducing a sequence point between subexpressions to guarantee this sequencing.

In Macros

The comma operator finds significant utility in preprocessor macros within C and C++, where it enables the sequencing of multiple expressions to simulate compound statements or ensure ordered evaluation of arguments with side effects, all while producing a single value from the final expression. This is particularly valuable in macro definitions that need to perform auxiliary operations without requiring separate statements, as the operator evaluates its left operand fully before the right, providing a sequence point. For example, a macro to log a value and then update a variable can be defined as #define LOG_UPDATE(x, y) (printf("Old value: %d\n", x), x = y), which prints the original x, assigns y to x, and returns the new value of x. In more complex macro definitions, the comma operator allows for operations like argument validation or initialization alongside the primary computation. A common extension beyond simple conditionals, such as the parenthesized #define MAX(a, b) ((a) > (b) ? (a) : (b)), involves expressions for temporary-free manipulations, though must be taken with side effects; for instance, an XOR-based swap macro might use #define XOR_SWAP(a, b) ((a) ^= (b), (b) ^= (a), (a) ^= (b)) to exchange values in sequence without extra storage. Historically, this usage became prevalent in C programming due to the language's lack of inline functions or lambdas for encapsulating multi-step logic, a limitation carried into early C++ for backward compatibility, though modern C++ alternatives like lambdas have reduced reliance on such macros. Despite its utility, overuse of the comma operator in macros can lead to pitfalls, such as unintended multiple evaluations of arguments during expansion or obscured control flow in the resulting code, potentially causing subtle bugs if side effects are not anticipated.

In Conditional Expressions

The comma operator facilitates the sequencing of side effects within the branches of the (?:), allowing multiple expressions to be evaluated in a guaranteed left-to-right order before selecting the final . In a construct such as condition ? (expression1, expression2, result) : alternative, the of the comma operator are evaluated sequentially, with all side effects from earlier expressions completing before subsequent ones, ensuring reliable execution of preparatory actions prior to the conditional selection. This approach leverages the comma operator's semantics, where the left is evaluated as a void expression and discarded, followed by evaluation of the right , which provides the for the . In control flow statements like if, the comma operator combines initialization and condition testing into a single expression, as in if ((initialization, condition)), where the initialization is performed first, followed by the condition evaluation that determines the branch taken. This sequencing introduces a sequence point between the operands, guaranteeing that any modifications from the initialization are visible before the condition is assessed, which is particularly useful for resource allocation or variable setup immediately preceding the test. By enforcing strict , the comma operator ensures deterministic in conditional branches, such as performing resource setup (e.g., locking a mutex or allocating memory) before executing branch-specific logic, thereby preventing race conditions or from unordered side effects. In C++, the core of the comma operator in conditional expressions remains unchanged from , but it interacts with language extensions like expressions, enabling sequenced invocations of lambdas for side effects within or if contexts without modifying the operator's fundamental rules. The comma operator's low precedence relative to the often necessitates parentheses to group expressions correctly, as detailed in language precedence rules.

In Function Returns

The comma operator finds application in function return statements to execute expressions with side effects immediately before returning a value, ensuring that actions such as or occur prior to exit. In such contexts, the left is evaluated and its result discarded, while the right determines the returned . For example, the statement return [log](/page/Log)("an error occurred"), -1; first calls the log function to record the event, then returns -1 as the 's result. This mechanism can simulate the computation of auxiliary values alongside the primary return value, where the left operand performs calculations or assignments that produce side effects—such as updating a or —while only the right operand's is actually returned. Consider return (status = validate_input(), processed_result);, which sets status based on the validation before returning processed_result; however, this does not enable true multiple-value returns, as the function yields solely the and type of the rightmost expression. A key use case involves pre-return cleanup to manage resources reliably across different exit paths. For instance, return (free_resources(), final_value); invokes free_resources() to deallocate or handles before returning final_value, preventing leaks in functions with conditional returns. This sequencing guarantees side effects complete before the function terminates, leveraging the operator's strict left-to-right evaluation order. Despite these utilities, the comma operator has inherent limitations in function returns: it cannot facilitate genuine multiple return values, in contrast to tuple or struct returns available in C++ or other languages like Python. Only the right operand contributes to the return type and value, rendering left operands suitable solely for side effects rather than data conveyance. The advent of C++17 structured bindings has reduced reliance on the comma operator for such patterns in contemporary code, as developers can return composite types like std::pair or std::tuple and unpack them cleanly at the caller site—e.g., auto [status, result] = func();—offering a more expressive alternative for handling related values. Nonetheless, the comma operator endures in legacy systems and scenarios demanding concise side-effect sequencing before returns.

In Statement Avoidance

The comma operator enables the execution of multiple expressions within contexts that traditionally require a single statement, such as the body of an if or while without curly braces, by sequencing them left-to-right and treating the sequence as one expression statement. For instance, in an if statement, if (condition) statement1, statement2; evaluates statement1 first (discarding its value), then statement2, with the overall value being that of statement2. This approach avoids the need for braces while ensuring sequential execution, as demonstrated in control flow examples where multiple outputs or operations follow a condition. In expression statements, the comma operator sequences assignments or function calls that might otherwise require separate lines or a block, effectively embedding them into a single statement without altering scope. For example, (x = 1, y = 2); assigns 1 to x, then 2 to y, and discards the result, serving as a compact way to initialize variables in contexts demanding one expression. This is particularly useful in initialization lists or simple sequencing where declarations are not involved, as the operands must be valid expressions. Although this usage promotes conciseness by avoiding braces, it often sparks debate over readability and maintainability, with critics arguing it obscures and increases error risk during modifications. Modern style guides, such as the SEI CERT C Coding Standard, explicitly recommend always using braces for if, for, and while bodies—even for single statements—to prevent unintended behavior from added lines, indirectly discouraging comma-based avoidance. Similarly, the Google C++ Style Guide permits brace omission only for simple single-line cases but favors braces for clarity in multi-statement scenarios, viewing comma chaining as potentially confusing. Edge cases arise in interactions with labels or goto statements, where the comma operator ensures a single expression statement follows the label without introducing a new block scope via braces. For example, label: expr1, expr2; goto next; sequences the expressions post-label while keeping variables in the enclosing , avoiding scope-related issues that might occur if braces were added for multiple statements. This preserves sequencing integrity in low-level control transfers without unnecessary scoping changes.

Examples

Basic Usage

The comma operator in C evaluates its left operand, discards the result, and then evaluates the right , returning the of the rightmost ; this allows sequencing multiple expressions where only the final matters. A fundamental use is in simple sequences, where multiple subexpressions are evaluated in order to compute a final . For instance, the expression (a = 1, b = 2, a + b) first assigns 1 to a, then 2 to b, and finally computes and returns a + b, yielding 3; this can be assigned to a as int x = (a = 1, b = 2, a + b);. To demonstrate side effects, consider an increment followed by a dependent assignment, such as i++, j = i * 2;, which first increments i and then assigns twice the new value of i to j, with the overall expression returning the value of j; this pattern often appears in loop bodies for compact updates, like within a for loop's update clause. The operator also enables "void" commas, where a function call with side effects is sequenced before a value-returning expression, discarding the former's result. An example is (printf("Hello"), 42);, which prints "Hello" and then returns 42 as the expression's value. Common errors arise from misunderstanding the need for parentheses to enforce grouping, as the comma has lower precedence than assignment. Without them, a = 1, 2; assigns 1 to a and then evaluates the integer literal 2 separately (as two statements), rather than sequencing within a single expression; correct usage requires (a = 1, 2) to return 2 after the assignment.

Advanced Scenarios

In advanced programming scenarios, the comma operator facilitates the sequencing of side-effect operations within macros, ensuring proper evaluation order without introducing temporary variables. A notable example is the XOR-based swap macro, which exchanges the values of two variables using bitwise operations chained via the comma operator. This approach, detailed in Stanford University's bit twiddling hacks collection, avoids by introducing sequence points between assignments. Consider the macro definition:
c
#define SWAP(a, b) (((a) ^= (b)), ((b) ^= (a)), ((a) ^= (b)))
When invoked as SWAP(x, y); with initial values x = 5 and y = 3, the preprocessor expands it to:
c
((x ^= y)), ((y ^= x)), ((x ^= y))
The evaluation proceeds as follows: the first expression evaluates x ^= y (with y=3, setting x to 6), discards the result, and proceeds; the second sets y ^= x (now x=6, to 5); the third sets x ^= y (now y=5, to 3). Thus, x becomes 3 and y becomes 5, achieving the swap. This expansion trace highlights how the comma operator enforces left-to-right evaluation while the overall expression value is the final assignment, typically discarded in statement context. Another sophisticated application appears in for-loops requiring multiple index updates, such as traversing an from both ends for symmetric processing or printing. For instance:
c
int arr[] = {1, 2, 3, 4, 5};
int n = sizeof(arr) / [sizeof](/page/Sizeof)(arr[0]);
for (int i = 0, j = n - 1; i < j; i++, j--) {
    [printf](/page/Printf)("%d %d\n", arr[i], arr[j]);
}
This loop initializes two indices, checks the condition on i and j, and updates both via the comma operator in the increment clause, printing pairs like 1 5 and 2 4. Such multi-variable leverages the comma operator's low precedence to combine expressions seamlessly, as described in C++ reference documentation for sequencing in loop controls. The comma operator also enables concise resource management in conditional returns, particularly where RAII is unavailable, by pairing cleanup actions with value returns in expressions. An example for handling a temporary allocation:
c
void* tmp = malloc(size);
if (cond) {
    // use tmp
    return ([free](/page/Free)(tmp), 1);
} else {
    [free](/page/Free)(tmp);
    return 0;
}
More compactly, it can integrate into the ternary:
c
return cond ? ([free](/page/Free)(tmp), 1) : ([free](/page/Free)(tmp), 0);
Here, regardless of cond, [free](/page/Free)(tmp) executes (discarding its void result), and the appropriate value is returned. This pattern ensures cleanup occurs before exit without separate blocks, a aligned with the operator's in evaluating side effects prior to yielding the rightmost value, per language specifications. In modern C++, the operator integrates with for inline side-effect sequencing before function calls, enhancing expressiveness in functional-style code. For example:
cpp
int a = 0;
([](int& val) { val++; }(a), std::cout << func(a));
The increments a (discarding its result), then the sequences to the output call with the updated a. This allows compact mutation and invocation, building on the 's sequencing while respecting captures and evaluation order as outlined in C++ operator references.

Implementations in Other Languages

C and C++

The comma operator was introduced in the first edition of The C Programming Language by Brian Kernighan and Dennis Ritchie in 1978, primarily to enable multiple expressions within the initialization and increment sections of for loops, such as for (i=0, j=1; i < n; i++, j++). This allowed sequencing of side-effect operations without requiring separate statements, addressing a need in early C for compact control flow in systems programming. It was formalized in the standard (X3.159-1989, also known as C89), where it is defined as a binary that evaluates its left (discarding the result), introduces a sequence point, and then evaluates and returns the value of the right . This specification ensured portable behavior across implementations, with the having the lowest precedence and associating left-to-right, making it suitable for chaining expressions like (a = 1, b = 2, a + b). C++ inherited the comma operator directly from C, retaining identical semantics across all standards from C++98 through , where it is specified in [expr.comma] as evaluating the left to discard, followed by evaluation of the right , whose value becomes the result with the type and value category of the right (as a prvalue if the right is not an lvalue). The introduction of rvalue references in C++11 did not alter the comma operator's behavior, preserving compatibility with C. In the standard (ISO/IEC 9899:2011), §6.5.17 explicitly confirms these rules: the left is evaluated as a void expression with a sequence point afterward, and the type and value of the result match the right after lvalue-to-rvalue conversion, if applicable. Similarly, [expr.comma] reiterates left-to-right evaluation and right-operand return, with no modifications from prior versions. provides extensions that enhance comma-like functionality through statement expressions, allowing compound statements within parentheses to act as expressions, such as ({ int x = 1; x += 2; x; }) which evaluates statements sequentially and returns the value of the last one. This non-standard feature is supported as a extension in compilers like and , enabling more complex sequencing in macros and expressions while mimicking the comma operator's sequencing but supporting declarations and .

JavaScript

In , the comma operator, introduced in the first edition of in 1997, evaluates its operands from left to right and returns the value of the rightmost operand. This behavior mirrors the comma operator in C, allowing multiple expressions to be sequenced within a single statement while discarding all results except the final one. The operator's syntax is defined as Expression : Expression , AssignmentExpression, with recursive application for multiple operands, ensuring strict left-to-right evaluation as specified in the standard. A common application occurs in immediately invoked function expressions (IIFEs), where the comma operator enables the sequencing of initialization code before invoking the main function, such as (function() { init(); }(), main());. This pattern allows side effects like variable setup or library loading to execute immediately without requiring separate statements, which is particularly useful in compact scripts or older browser environments lacking modern module systems. In loops, especially for iterations over arrays, the comma operator facilitates performance optimizations by initializing multiple variables in the header, for example: for (let i = 0, len = arr.length; i < len; i++) { ... }. Here, caching the array length avoids repeated property access on each iteration, which can improve efficiency in large datasets or tight loops, as array lengths are not cached by default in JavaScript engines. The comma operator interacts with JavaScript's hoisting mechanism, where var declarations in left operands are hoisted to the top of their , potentially altering availability before evaluation, unlike let or const which respect temporal dead zones. In strict mode, the operator's left-to-right evaluation order is rigidly enforced without exceptions, preventing ambiguities that might arise in non-strict contexts due to hoisting or undeclared variables. This enforcement aligns with ECMAScript's evolution toward predictable behavior across environments.

Perl and Similar

In Perl, the comma operator serves a dual role depending on the evaluation context. In list context, it functions primarily as a list constructor and argument separator, allowing multiple expressions to be combined into a list, such as @arr = (1, 2, 3);, where the parentheses enclose to form an array. In scalar context, it acts as a sequencing operator, evaluating its left argument (discarding its value) before evaluating and returning the value of its right argument, similar to its behavior for side-effect execution in (print "Hello", $x = 42);, which prints "Hello" and assigns 42 to $x before returning 42. Introduced in Perl 5, first released on October 17, 1994, the comma operator has low precedence among Perl's operators, ensuring it is evaluated after most other operations but before assignment, and it is left-associative, meaning expressions like (a, b, c) are grouped as ((a, b), c) in scalar context, evaluating from left to right with side effects preserved in sequence. This context sensitivity distinguishes it from the comma operator in languages like C, where it always returns a single value without list construction capabilities. In modern , enabling warnings via use warnings; can produce warnings in void contexts for useless use of expressions, which may apply to left-side operands of the comma operator that produce unused values. , influenced by Perl's design, employs commas in a similar manner for multiple , enabling parallel initialization in a single statement, as in a, b = 1, 2, which assigns 1 to a and 2 to b by treating the right side as a unpacked to the left-side variables. This simulates parallel assignment without explicit temporaries, evaluating right-hand expressions before distribution, though Ruby lacks Perl's explicit scalar/ context distinction for the comma itself—instead integrating it into and argument handling. Like Perl, Ruby's use emphasizes concise separation over pure sequencing, but style guides recommend limiting parallel assignment to avoid readability issues in complex cases.

References

  1. [1]
  2. [2]
  3. [3]
    Comma operator (,) - JavaScript - MDN Web Docs
    Jul 8, 2025 · The comma ( , ) operator evaluates each of its operands (from left to right) and returns the value of the last operand.
  4. [4]
  5. [5]
  6. [6]
  7. [7]
    Comma Operator: , | Microsoft Learn
    Mar 1, 2024 · The comma operator has left-to-right associativity. Two expressions separated by a comma are evaluated left to right. The left operand is always evaluated.<|control11|><|separator|>
  8. [8]
  9. [9]
    [PDF] for information systems - programming language - C
    This standard specifies the syntax and semantics of programs written in the C programming language.
  10. [10]
    c++ - How does the comma operator work, and what precedence ...
    Sep 10, 2008 · The comma operator has the lowest precedence of all C/C++ operators. Therefore it's always the last one to bind to an expression.The comma operator in a declaration - c++ - Stack Overflowc++ - What is the proper use of the comma operator? - Stack OverflowMore results from stackoverflow.com
  11. [11]
  12. [12]
  13. [13]
  14. [14]
    [PDF] ISO/IEC 9899:1999(E) -- Programming Languages -- C
    4. International Standard ISO/IEC9899 was prepared by Joint Technical. Committee ISO/IEC JTC 1, Information technology, Subcommittee SC 22,. Programming ...
  15. [15]
    [PDF] C++ International Standard
    May 30, 2016 · ... Comma operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134. 5.20 Constant expressions ...
  16. [16]
    C++ Comma Operator - Tutorials Point
    The purpose of comma operator is to string together several expressions. The value of a comma-separated list of expressions is the value of the right-most ...<|control11|><|separator|>
  17. [17]
    How can we use Comma operator in place of curly braces?
    Jul 11, 2025 · In C and C++, comma (, ) can be used in two contexts: Comma as an operator · Comma as a separator. But in this article, we will discuss how ...
  18. [18]
    Google C++ Style Guide
    The goal of this guide is to manage this complexity by describing in detail the dos and don'ts of writing C++ code.Header Files · Scoping
  19. [19]
    Bit Twiddling Hacks
    ### Summary: Swapping Values with XOR from http://graphics.stanford.edu/~seander/bithacks.html
  20. [20]
    Dark Corners of C - The Comma Operator - Stephen Friederichs
    Jul 23, 2015 · Its purpose is to join together expressions into one line in a very specific way: the expression to the left of the comma is first evaluated and ...
  21. [21]
    [PDF] Rationale for International Standard - Programming Language - C
    operand of a conditional operator, or may be an operand of a comma operator. 6.5.2 Postfix operators. 6.5.2.1 Array subscripting. 15. The C89 Committee found ...
  22. [22]
    Statement Exprs (Using the GNU Compiler Collection (GCC))
    A compound statement enclosed in parentheses may appear as an expression in GNU C. This allows you to use loops, switches, and local variables within an ...Missing: comma | Show results with:comma
  23. [23]
  24. [24]
  25. [25]
  26. [26]
    perlop - Perl expressions: operators, precedence, string literals
    DESCRIPTION. In Perl, the operator determines what operation is performed, independent of the type of the operands. For example $x + $y is always a numeric ...Terms and List Operators... · Comma Operator · Quote and Quote-like Operators
  27. [27]
    Perl turns 30 and its community continues to thrive - Opensource.com
    Oct 11, 2017 · Perl 5.000, released on October 17, 1994, was a nearly complete rewrite of the interpreter. New features included objects, references, lexical ...
  28. [28]
  29. [29]
    assignment - RDoc Documentation - Ruby-Doc.org
    You can use multiple assignment to swap two values in-place: old_value = 1 new_value, old_value = old_value, 2 p new_value: new_value, old_value: old_value ...Missing: parallel | Show results with:parallel
  30. [30]
    Ruby Style Guide
    This Ruby style guide recommends best practices so that real-world Ruby programmers can write code that can be maintained by other real-world Ruby programmers.