Knowledge (XXG)

Comma operator

Source 📝

1383:
The comma can be used in return statements, to assign to a global variable or out parameter (passed by reference). This idiom suggests that the assignments are part of the return, rather than auxiliary assignments in a block that terminates with the actual return. For example, in setting a global
922:
the second operand. Further, because it is rarely used outside of specific idioms, and easily mistaken with other commas or the semicolon, it is potentially confusing and error-prone. Nevertheless, there are certain circumstances where it is commonly used, notably in for loops and in
160:
In this example, the differing behavior between the second and third lines is due to the comma operator having lower precedence than assignment. The last example differs as well since the return expression must be fully evaluated before the function can return.
1081:
Outside of for loop initializers (which have a special use of semicolons), the comma might be used instead of a semicolon, particularly when the statements in question function similarly to a loop increment (e.g. at the end of a while loop):
147:
with multiple arguments was added making unparenthesised comma expressions unusable in subscripts. The comma operator is still usable and not deprecated in this context if the comma expression is surrounded by parentheses (as in
927:. For embedded systems which may have limited debugging capabilities, the comma operator can be used in combination with a macro to seamlessly override a function call, to insert code just before the function call. 120:. In a combination of commas and semicolons, semicolons have lower precedence than commas, as semicolons separate statements but commas occur within statements, which accords with their use as ordinary punctuation: 1849:, "Finally, Go has no comma operator and ++ and -- are statements not expressions. Thus if you want to run multiple variables in a for you should use parallel assignment (although that precludes ++ and --)." 1765:
Two expressions separated by a comma are evaluated left to right. The left operand is always evaluated, and all side effects are completed before the right operand is evaluated.
1312:
The comma can be used within a condition (of an if, while, do while, or for) to allow auxiliary computations, particularly calling a function and using the result, with
1871: 1702:, the comma is a separator used to separate elements in a list in various contexts. It is not an operator and does not evaluate to the last element in the list. 914:
The comma operator has relatively limited use cases. Because it discards its first operand, it is generally only useful where the first operand has desirable
1074:, which allows multiple assignments to occur within a single statement, and also uses a comma, though with different syntax and semantics. This is used in 1741: 943:. This is the only idiomatic use in elementary C programming. In the following example, the order of the loop's initializers is significant: 1920: 2010: 1133:
One common use is to provide custom error messages in failed assertions. This is done by passing a parenthesized expression list to the
2039: 2049: 55: 1894:
You can use the comma operator when you want to include multiple expressions in a location that requires a single expression.
1881: 915: 139:); to reduce confusion, and open up the future possibility of repurposing the syntax for multidimensional array indexing. In 89:
and sequences of expressions are enclosed in parentheses analogously to how sequences of statements are enclosed in braces:
1130:
The comma can be used in preprocessor macros to perform multiple operations in the space of a single syntactic expression.
1301:
i = 0 i = 1 i = 2 i = 3 i = 4 assert: assert.c:6: test_assert: Assertion `( "i is too big!", i <= 4 )' failed. Aborted
936: 101:
is a sequence of statements, and does not evaluate to any value. A comma can only occur between two expressions – commas
1952: 1699: 1687: 1137:
macro, where the first expression is an error string and the second expression is the condition being asserted. The
1372: 1075: 1716: 939:
statements without using a block statement, primarily in the initialization and the increment expressions of a
113: 20: 2023: 46:
and discards the result, and then evaluates the second operand and returns this value (and type); there is a
1721: 1777: 1930: 1752: 1802: 63:
and definitions, variable declarations, enum declarations, and similar constructs, where it acts as a
1304:
However the assert macro is usually disabled in production code, so use it only for debug purposes.
105:
expressions – unlike the semicolon, which occurs at the end of a (non-block) statement – semicolons
1071: 2019: 1925: 868:* allow for the construct return(value), the parentheses are only relative to "value" 1990: 1801:
Mark Hoemmen; Daisy Hollman; Corentin Jabot; Isabella Muerte; Christian Trott (2021-09-14).
1141:
macro outputs its argument verbatim on an assertion failure. The following is an example:
93:
is a sequence of expressions, separated by commas, which evaluates to the last expression
39: 2044: 1711: 117: 47: 32: 1906: 2033: 1313: 874:* Return simply gets an expression and here the expression is "(1), 2, 3". 403:* Increases value of a by 2, then assigns value of resulting operation a + b into i. 60: 1819: 688:* Commas act as separators in the first line and as an operator in the second line. 406:* Commas act as separators in the first line and as an operator in the second line. 235:* Commas act as separators in the first line and as an operator in the second line. 1876: 502:* Commas act as separators in the first line and as an operator in the third line. 1478:
For brevity, the comma can be used to avoid a block and associated braces, as in:
862:* Returns 3, not 1, still for same reason as above. This example works as it does 1375:, where the syntax of the if statement explicitly allows an optional statement. 865:* because return is a keyword, not a function call. Even though compilers will 772:* Returns 6, not 4, since comma operator sequence points following the keyword 598:* The braces on the second line avoid variable redeclaration in the same block, 319:* The braces on the second line avoid variable redeclaration in the same block, 132: 2026:
library that makes it easy to fill containers by overloading the comma operator
1846: 1691: 493:* Increases value of a by 2, then stores value of a to i, and discards unused 1859: 1746: 82: 65: 1842: 1778:"P1161R2: Deprecate uses of the comma operator in subscripting expressions" 775:* return are considered a single expression evaluating to rvalue of final 940: 140: 136: 43: 1690:
programming languages, the semicolon (";") is used for this purpose.
924: 691:* Assigns value of c into i, discarding the unused a and b values. 24: 1683: 1695: 1070:
An alternative solution to this problem in other languages is
169:* Commas act as separators in this line, not as an operator. 2011:
Effect of using a comma instead of a semi-colon in C and C++
1907:"Perlop - Perl operators and precedence - Perldoc Browser" 1698:
utilize the comma operator in the same way C/C++ does. In
604:* The second b and c declared are given no initial value. 829:* Returns 3, not 1, for same reason as previous example. 871:* and have no special effect on the return keyword. 1997:(2nd ed.), Englewood Cliffs, NJ: Prentice Hall 325:* The second b declared is given no initial value. 81:(which have value) in a way analogous to how the 1982:Fundamentals of computers and programming in C 1953:"Is comma (,) operator or separator in Java?" 8: 1858:The Go Programming Language Specification: 128:because these are two separate statements. 595:* Commas act as separators in both lines. 316:* Commas act as separators in both lines. 935:The most common use is to allow multiple 601:* which would cause a compilation error. 322:* which would cause a compilation error. 877:* Commas act as operators in this line. 832:* Commas act as operators in this line. 781:* Commas act as operators in this line. 499:* Equivalent to: (i = (a += 2)), a + b; 1733: 1427:This can be written more verbosely as: 496:* values of resulting operation a + b. 1803:"Multidimensional subscript operator" 16:Programming languages binary operator 7: 1975:, New Delhi: Prentice Hall of India 313:* Equivalent to: int i = a; int b; 135:in subscripting expressions (as of 112:The comma operator has the lowest 14: 1880:. 17 January 2020. Archived from 116:of any C operator, and acts as a 53:The use of the comma token as an 1984:, New Delhi: Laxmi Publications 1363:// statements involving x and y 694:* Results: a=1, b=2, c=3, i=3 607:* Results: a=1, b=2, c=3, i=1 505:* Results: a=3, b=2, c=3, i=3 409:* Results: a=3, b=2, c=3, i=5 328:* Results: a=1, b=2, c=3, i=1 238:* Results: a=1, b=2, c=3, i=2 172:* Results: a=1, b=2, c=3, i=0 1: 592:* Assigns value of a into i. 310:* Assigns value of a into i. 232:* Assigns value of b into i. 77:The comma operator separates 131:The comma operator has been 59:is distinct from its use in 1078:in its analogous for loop. 50:between these evaluations. 27:programming languages, the 2066: 1995:The C Programming Language 1371:A similar idiom exists in 143:, the ability to overload 1973:Computer Programming in C 1236:"i is too big!" 42:that evaluates its first 2040:C (programming language) 1624: 1575: 1526: 1480: 1429: 1386: 1318: 1143: 1084: 945: 163: 2050:Operators (programming) 1921:"2.4. Grammar Notation" 1971:Ramajaran, V. (1994), 1722:Operator (programming) 1717:Operators in C and C++ 1989:Kernighan, Brian W.; 778:* subexpression c=6. 2022:– facility from the 31:(represented by the 1980:Dixit, J.B (2005), 1824:en.cppreference.com 1072:parallel assignment 1991:Ritchie, Dennis M. 1926:Oracle Corporation 2057: 2020:Boost.Assignment 1998: 1985: 1976: 1957: 1956: 1949: 1943: 1942: 1940: 1938: 1929:. Archived from 1917: 1911: 1910: 1903: 1897: 1896: 1891: 1889: 1872:"Comma operator" 1868: 1862: 1856: 1850: 1840: 1834: 1833: 1831: 1830: 1816: 1810: 1809: 1807: 1798: 1792: 1791: 1789: 1788: 1782:www.open-std.org 1774: 1768: 1767: 1762: 1760: 1755:on 2 August 2019 1751:. Archived from 1742:"Comma Operator" 1738: 1673: 1670: 1667: 1664: 1661: 1658: 1655: 1652: 1649: 1646: 1643: 1640: 1637: 1634: 1631: 1628: 1621: 1618: 1615: 1612: 1609: 1606: 1603: 1600: 1597: 1594: 1591: 1588: 1585: 1582: 1579: 1569: 1566: 1563: 1560: 1557: 1554: 1551: 1548: 1545: 1542: 1539: 1536: 1533: 1530: 1523: 1520: 1517: 1514: 1511: 1508: 1505: 1502: 1499: 1496: 1493: 1490: 1487: 1484: 1469: 1466: 1463: 1460: 1457: 1454: 1451: 1448: 1445: 1442: 1439: 1436: 1433: 1423: 1420: 1417: 1414: 1411: 1408: 1405: 1402: 1399: 1396: 1393: 1390: 1367: 1364: 1361: 1358: 1355: 1352: 1349: 1346: 1343: 1340: 1337: 1334: 1331: 1328: 1325: 1322: 1294: 1291: 1288: 1285: 1282: 1279: 1276: 1273: 1270: 1267: 1264: 1261: 1258: 1255: 1252: 1249: 1246: 1243: 1240: 1237: 1234: 1231: 1228: 1225: 1222: 1219: 1216: 1213: 1210: 1207: 1204: 1201: 1198: 1195: 1192: 1189: 1186: 1183: 1180: 1177: 1174: 1171: 1168: 1165: 1162: 1159: 1156: 1155:<assert.h> 1153: 1150: 1147: 1140: 1136: 1121: 1118: 1115: 1112: 1109: 1106: 1103: 1100: 1097: 1094: 1091: 1088: 1066: 1063: 1060: 1057: 1054: 1051: 1048: 1045: 1042: 1039: 1036: 1033: 1030: 1027: 1024: 1021: 1018: 1015: 1012: 1009: 1006: 1003: 1000: 997: 994: 991: 988: 985: 982: 979: 976: 973: 970: 967: 964: 961: 958: 955: 952: 949: 920:sequenced before 905: 902: 899: 896: 893: 890: 887: 884: 881: 878: 875: 872: 869: 866: 863: 860: 857: 854: 851: 848: 845: 842: 839: 836: 833: 830: 827: 824: 821: 818: 815: 812: 809: 806: 803: 800: 797: 794: 791: 788: 785: 782: 779: 776: 773: 770: 767: 764: 761: 758: 755: 752: 749: 746: 743: 740: 737: 734: 731: 728: 725: 722: 719: 716: 713: 710: 707: 704: 701: 698: 695: 692: 689: 686: 683: 680: 677: 674: 671: 668: 665: 662: 659: 656: 653: 650: 647: 644: 641: 638: 635: 632: 629: 626: 623: 620: 617: 614: 611: 608: 605: 602: 599: 596: 593: 590: 587: 584: 581: 578: 575: 572: 569: 566: 563: 560: 557: 554: 551: 548: 545: 542: 539: 536: 533: 530: 527: 524: 521: 518: 515: 512: 509: 506: 503: 500: 497: 494: 491: 488: 485: 482: 479: 476: 473: 470: 467: 464: 461: 458: 455: 452: 449: 446: 443: 440: 437: 434: 431: 428: 425: 422: 419: 416: 413: 410: 407: 404: 401: 398: 395: 392: 389: 386: 383: 380: 377: 374: 371: 368: 365: 362: 359: 356: 353: 350: 347: 344: 341: 338: 335: 332: 329: 326: 323: 320: 317: 314: 311: 308: 305: 302: 299: 296: 293: 290: 287: 284: 281: 278: 275: 272: 269: 266: 263: 260: 257: 254: 251: 248: 245: 242: 239: 236: 233: 230: 227: 224: 221: 218: 215: 212: 209: 206: 203: 200: 197: 194: 191: 188: 185: 182: 179: 176: 173: 170: 167: 151: 146: 127: 123: 100: 96: 92: 37: 2065: 2064: 2060: 2059: 2058: 2056: 2055: 2054: 2030: 2029: 2006: 2001: 1988: 1979: 1970: 1966: 1961: 1960: 1951: 1950: 1946: 1936: 1934: 1933:on 22 July 2019 1919: 1918: 1914: 1905: 1904: 1900: 1887: 1885: 1884:on 12 July 2014 1870: 1869: 1865: 1857: 1853: 1841: 1837: 1828: 1826: 1818: 1817: 1813: 1805: 1800: 1799: 1795: 1786: 1784: 1776: 1775: 1771: 1758: 1756: 1740: 1739: 1735: 1730: 1708: 1680: 1678:Other languages 1675: 1674: 1671: 1668: 1665: 1662: 1659: 1656: 1653: 1650: 1647: 1644: 1641: 1638: 1635: 1632: 1629: 1626: 1623: 1622: 1619: 1616: 1613: 1610: 1607: 1604: 1601: 1598: 1595: 1592: 1589: 1586: 1583: 1580: 1577: 1571: 1570: 1567: 1564: 1561: 1558: 1555: 1552: 1549: 1546: 1543: 1540: 1537: 1534: 1531: 1528: 1525: 1524: 1521: 1518: 1515: 1512: 1509: 1506: 1503: 1500: 1497: 1494: 1491: 1488: 1485: 1482: 1476: 1471: 1470: 1467: 1464: 1461: 1458: 1455: 1452: 1449: 1446: 1443: 1440: 1437: 1434: 1431: 1425: 1424: 1421: 1418: 1415: 1412: 1409: 1406: 1403: 1400: 1397: 1394: 1391: 1388: 1381: 1369: 1368: 1365: 1362: 1359: 1356: 1353: 1350: 1347: 1344: 1341: 1338: 1335: 1332: 1329: 1326: 1323: 1320: 1310: 1302: 1296: 1295: 1292: 1289: 1286: 1283: 1280: 1277: 1274: 1271: 1268: 1265: 1262: 1259: 1256: 1253: 1250: 1247: 1244: 1241: 1238: 1235: 1232: 1229: 1226: 1223: 1220: 1217: 1214: 1211: 1208: 1205: 1202: 1199: 1196: 1193: 1190: 1187: 1184: 1181: 1178: 1175: 1172: 1169: 1166: 1163: 1160: 1157: 1154: 1151: 1149:<stdio.h> 1148: 1145: 1138: 1134: 1128: 1123: 1122: 1119: 1116: 1113: 1110: 1107: 1104: 1101: 1098: 1095: 1092: 1089: 1086: 1068: 1067: 1064: 1061: 1058: 1055: 1052: 1049: 1046: 1043: 1040: 1037: 1034: 1031: 1028: 1025: 1022: 1019: 1016: 1013: 1010: 1007: 1004: 1001: 998: 995: 992: 989: 986: 983: 980: 977: 974: 971: 968: 965: 962: 959: 956: 953: 950: 947: 933: 912: 907: 906: 903: 900: 897: 894: 891: 888: 885: 882: 879: 876: 873: 870: 867: 864: 861: 858: 855: 852: 849: 846: 843: 840: 837: 834: 831: 828: 825: 822: 819: 816: 813: 810: 807: 804: 801: 798: 795: 792: 789: 786: 783: 780: 777: 774: 771: 768: 765: 762: 759: 756: 753: 750: 747: 744: 741: 738: 735: 732: 729: 726: 723: 720: 717: 714: 711: 708: 705: 702: 699: 696: 693: 690: 687: 684: 681: 678: 675: 672: 669: 666: 663: 660: 657: 654: 651: 648: 645: 642: 639: 636: 633: 630: 627: 624: 621: 618: 615: 612: 609: 606: 603: 600: 597: 594: 591: 588: 585: 582: 579: 576: 573: 570: 567: 564: 561: 558: 555: 552: 549: 546: 543: 540: 537: 534: 531: 528: 525: 522: 519: 516: 513: 510: 507: 504: 501: 498: 495: 492: 489: 486: 483: 480: 477: 474: 471: 468: 465: 462: 459: 456: 453: 450: 447: 444: 441: 438: 435: 432: 429: 426: 423: 420: 417: 414: 411: 408: 405: 402: 399: 396: 393: 390: 387: 384: 381: 378: 375: 372: 369: 366: 363: 360: 357: 354: 351: 348: 345: 342: 339: 336: 333: 330: 327: 324: 321: 318: 315: 312: 309: 306: 303: 300: 297: 294: 291: 288: 285: 282: 279: 276: 273: 270: 267: 264: 261: 258: 255: 252: 249: 246: 243: 240: 237: 234: 231: 228: 225: 222: 219: 216: 213: 210: 207: 204: 201: 198: 195: 192: 189: 186: 183: 180: 177: 174: 171: 168: 165: 158: 149: 144: 125: 121: 98: 94: 90: 75: 40:binary operator 35: 17: 12: 11: 5: 2063: 2061: 2053: 2052: 2047: 2042: 2032: 2031: 2028: 2027: 2017: 2015:Stack Overflow 2005: 2004:External links 2002: 2000: 1999: 1986: 1977: 1967: 1965: 1962: 1959: 1958: 1944: 1912: 1898: 1863: 1851: 1835: 1811: 1793: 1769: 1732: 1731: 1729: 1726: 1725: 1724: 1719: 1714: 1712:Sequence point 1707: 1704: 1679: 1676: 1625: 1576: 1527: 1481: 1475: 1472: 1430: 1387: 1384:error number: 1380: 1379:Complex return 1377: 1319: 1309: 1306: 1300: 1144: 1127: 1124: 1085: 946: 932: 929: 911: 908: 164: 157: 154: 126:(a, b); (c, d) 124:is grouped as 118:sequence point 74: 71: 68: 61:function calls 58: 48:sequence point 29:comma operator 15: 13: 10: 9: 6: 4: 3: 2: 2062: 2051: 2048: 2046: 2043: 2041: 2038: 2037: 2035: 2025: 2021: 2018: 2016: 2012: 2008: 2007: 2003: 1996: 1992: 1987: 1983: 1978: 1974: 1969: 1968: 1963: 1954: 1948: 1945: 1932: 1928: 1927: 1922: 1916: 1913: 1908: 1902: 1899: 1895: 1883: 1879: 1878: 1873: 1867: 1864: 1861: 1860:If statements 1855: 1852: 1848: 1844: 1839: 1836: 1825: 1821: 1815: 1812: 1804: 1797: 1794: 1783: 1779: 1773: 1770: 1766: 1754: 1750: 1748: 1743: 1737: 1734: 1727: 1723: 1720: 1718: 1715: 1713: 1710: 1709: 1705: 1703: 1701: 1697: 1693: 1689: 1685: 1677: 1574: 1479: 1474:Avoid a block 1473: 1428: 1385: 1378: 1376: 1374: 1317: 1315: 1314:block scoping 1307: 1305: 1299: 1142: 1131: 1125: 1083: 1079: 1077: 1073: 944: 942: 938: 930: 928: 926: 921: 918:that must be 917: 909: 162: 155: 153: 142: 138: 134: 129: 119: 115: 110: 108: 104: 88: 84: 80: 72: 70: 67: 64: 62: 57: 54: 51: 49: 45: 41: 34: 30: 26: 22: 2014: 1994: 1981: 1972: 1964:Bibliography 1947: 1935:. Retrieved 1931:the original 1924: 1915: 1901: 1893: 1886:. Retrieved 1882:the original 1877:MDN Web Docs 1875: 1866: 1854: 1843:Effective Go 1838: 1827:. Retrieved 1823: 1814: 1796: 1785:. Retrieved 1781: 1772: 1764: 1757:. Retrieved 1753:the original 1745: 1736: 1681: 1573:instead of: 1572: 1477: 1426: 1382: 1370: 1311: 1303: 1297: 1263:"i = %i 1132: 1129: 1080: 1069: 934: 919: 916:side effects 913: 159: 130: 111: 109:statements. 106: 102: 86: 78: 76: 52: 28: 18: 87:statements, 85:terminates 79:expressions 2034:Categories 1888:25 January 1829:2022-08-30 1787:2022-09-05 1728:References 1692:JavaScript 937:assignment 133:deprecated 122:a, b; c, d 114:precedence 99:{a; b; c;} 1747:Microsoft 1308:Condition 931:For loops 107:terminate 91:(a, b, c) 83:semicolon 66:separator 1993:(1988), 1820:"SFINAE" 1759:1 August 1749:dev docs 1706:See also 1298:Output: 1152:#include 1146:#include 941:for loop 156:Examples 145:operator 103:separate 97:, while 56:operator 1937:25 July 1682:In the 1438:failure 1395:failure 1047:putchar 44:operand 38:) is a 19:In the 1459:return 1453:EINVAL 1413:EINVAL 1401:return 1284:return 1269:" 1257:printf 1227:assert 1139:assert 1135:assert 1126:Macros 969:size_t 925:SFINAE 883:return 838:return 787:return 73:Syntax 2024:Boost 1806:(PDF) 1684:OCaml 1447:errno 1407:errno 1245:<= 1206:<= 1029:first 1026:>= 999:first 987:first 141:C++23 137:C++20 33:token 1939:2019 1890:2020 1761:2019 1700:Java 1696:Perl 1694:and 1688:Ruby 1686:and 1348:> 1167:void 1161:main 981:char 957:char 948:void 910:Uses 23:and 2045:C++ 2013:", 1847:for 1360:... 1185:for 1176:int 1158:int 1017:len 993:for 972:len 951:rev 859:/** 826:/** 769:/** 739:int 700:int 685:/** 655:int 613:int 589:/** 550:int 511:int 490:/** 454:int 415:int 400:/** 376:int 334:int 307:/** 283:int 244:int 229:/** 178:int 166:/** 152:). 25:C++ 2036:: 1923:. 1892:. 1874:. 1845:: 1822:. 1780:. 1763:. 1744:. 1636:== 1627:if 1620:;} 1587:== 1578:if 1538:== 1529:if 1492:== 1483:if 1462:-1 1432:if 1422:); 1419:-1 1389:if 1373:Go 1342:), 1321:if 1316:: 1278:); 1266:\n 1254:); 1218:++ 1114:++ 1105:++ 1096:++ 1087:++ 1076:Go 1059:); 1035:-- 1014:+= 892:), 880:*/ 835:*/ 784:*/ 766:); 697:*/ 610:*/ 568:+= 508:*/ 487:); 469:+= 412:*/ 331:*/ 304:); 241:*/ 175:*/ 69:. 2009:" 1955:. 1941:. 1909:. 1832:. 1808:. 1790:. 1672:} 1669:; 1666:3 1663:= 1660:z 1657:; 1654:2 1651:= 1648:y 1645:{ 1642:) 1639:1 1633:x 1630:( 1617:3 1614:= 1611:z 1608:; 1605:2 1602:= 1599:y 1596:{ 1593:) 1590:1 1584:x 1581:( 1568:; 1565:3 1562:= 1559:z 1556:, 1553:2 1550:= 1547:y 1544:) 1541:1 1535:x 1532:( 1522:; 1519:3 1516:= 1513:z 1510:, 1507:2 1504:= 1501:y 1498:) 1495:1 1489:x 1486:( 1468:} 1465:; 1456:; 1450:= 1444:{ 1441:) 1435:( 1416:, 1410:= 1404:( 1398:) 1392:( 1366:} 1357:{ 1354:) 1351:x 1345:y 1339:x 1336:( 1333:f 1330:= 1327:y 1324:( 1293:} 1290:; 1287:0 1281:} 1275:i 1272:, 1260:( 1251:) 1248:4 1242:i 1239:, 1233:( 1230:( 1224:{ 1221:) 1215:i 1212:; 1209:9 1203:i 1200:; 1197:0 1194:= 1191:i 1188:( 1182:; 1179:i 1173:{ 1170:) 1164:( 1120:; 1117:q 1111:; 1108:p 1102:; 1099:q 1093:, 1090:p 1065:} 1062:} 1056:s 1053:* 1050:( 1044:{ 1041:) 1038:s 1032:; 1023:s 1020:; 1011:s 1008:, 1005:s 1002:= 996:( 990:; 984:* 978:{ 975:) 966:, 963:s 960:* 954:( 904:; 901:3 898:, 895:2 889:1 886:( 856:; 853:3 850:, 847:2 844:, 841:1 823:; 820:6 817:= 814:c 811:, 808:5 805:= 802:b 799:, 796:4 793:= 790:a 763:c 760:, 757:b 754:, 751:a 748:( 745:= 742:i 736:; 733:3 730:= 727:c 724:, 721:2 718:= 715:b 712:, 709:1 706:= 703:a 682:} 679:; 676:c 673:, 670:b 667:, 664:a 661:= 658:i 652:{ 649:; 646:3 643:= 640:c 637:, 634:2 631:= 628:b 625:, 622:1 619:= 616:a 586:; 583:b 580:+ 577:a 574:, 571:2 565:a 562:= 559:i 556:; 553:i 547:; 544:3 541:= 538:c 535:, 532:2 529:= 526:b 523:, 520:1 517:= 514:a 484:b 481:+ 478:a 475:, 472:2 466:a 463:( 460:= 457:i 451:; 448:3 445:= 442:c 439:, 436:2 433:= 430:b 427:, 424:1 421:= 418:a 397:} 394:; 391:b 388:, 385:a 382:= 379:i 373:{ 370:; 367:3 364:= 361:c 358:, 355:2 352:= 349:b 346:, 343:1 340:= 337:a 301:b 298:, 295:a 292:( 289:= 286:i 280:; 277:3 274:= 271:c 268:, 265:2 262:= 259:b 256:, 253:1 250:= 247:a 226:; 223:0 220:= 217:i 214:, 211:3 208:= 205:c 202:, 199:2 196:= 193:b 190:, 187:1 184:= 181:a 150:a 95:c 36:, 21:C

Index

C
C++
token
binary operator
operand
sequence point
operator
function calls
separator
semicolon
precedence
sequence point
deprecated
C++20
C++23
side effects
SFINAE
assignment
for loop
parallel assignment
Go
block scoping
Go
OCaml
Ruby
JavaScript
Perl
Java
Sequence point
Operators in C and C++

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.