Knowledge (XXG)

Compatibility of C and C++

Source đź“ť

406:, the creator of C++, has suggested that the incompatibilities between C and C++ should be reduced as much as possible in order to maximize interoperability between the two languages. Others have argued that since C and C++ are two different languages, compatibility between them is useful but not vital; according to this camp, efforts to reduce incompatibility should not hinder attempts to improve each language in isolation. The official rationale for the 1999 C standard ( 3908: 3377: 442:
C++ enforces stricter typing rules (no implicit violations of the static type system), and initialization requirements (compile-time enforcement that in-scope variables do not have initialization subverted) than C, and so some valid C code is invalid in C++. A rationale for these is provided in Annex
1682:
is explicitly used) and inline definitions. C++, on the other hand, provides only inline definitions for inline functions. In C, an inline definition is similar to an internal (i.e. static) one, in that it can coexist in the same program with one external definition and any number of internal and
399:
of C++, and nontrivial C programs will not compile as C++ code without modification. Likewise, C++ introduces many features that are not available in C and in practice almost all code written in C++ is not conforming C code. This article, however, focuses on differences that cause conforming C code
1670:
In C, use of inline functions requires manually adding a prototype declaration of the function using the extern keyword in exactly one translation unit to ensure a non-inlined version is linked in, whereas C++ handles this automatically. In more detail, C distinguishes two kinds of definitions of
929:
Non-prototype ("K&R"-style) function declarations are invalid in C++; they are still valid in C until C23, although they have been deemed obsolescent since C's original standardization in 1990. (The term "obsolescent" is a defined term in the ISO C standard, meaning a feature that "may be
1199:, which takes the syntactic form of an array with unspecified length. This serves a purpose similar to variable-length arrays, but VLAs cannot appear in type definitions, and unlike VLAs, flexible array members have no defined size. ISO C++ has no such feature. Example: 1687:
of the function, but not an independent one. C compilers are afforded the discretion to choose between using inline and external definitions of the same function when both are visible. C++, however, requires that if a function with external linkage is declared
410:) "endorse the principle of maintaining the largest common subset" between C and C++ "while maintaining a distinction between them and allowing them to evolve separately", and stated that the authors were "content to let C++ be the big and ambitious language." 2525:("It is invalid to jump past a declaration with explicit or implicit initializer (except across entire block not entered). … With this simple compile-time rule, C++ assures that if an initialized variable is in scope, then it has assuredly been initialized.") 945:. In contrast, in C++ a function prototype without arguments means that the function takes no arguments, and calling such a function with arguments is ill-formed. In C, the correct way to declare a function that takes no arguments is by using 'void', as in 1692:
in any translation unit then it must be so declared (and therefore also defined) in every translation unit where it is used, and that all the definitions of that function be identical, following the ODR. Static inline functions behave identically in C and
1810:
Several of the other differences from the previous section can also be exploited to create code that compiles in both languages but behaves differently. For example, the following function will return different values in C and C++:
1949:
While C and C++ maintain a large degree of source compatibility, the object files their respective compilers produce can have important differences that manifest themselves when intermixing C and C++ code. Notably:
930:
considered for withdrawal in future revisions" of the standard.) Similarly, implicit function declarations (using functions that have not been declared) are not allowed in C++, and have been invalid in C since 1999.
193: 348: 124: 154: 1667:
is the default for all file-scoped entities. In practice this does not lead to silent semantic changes between identical C and C++ code but instead will lead to a compile-time or linkage error.
104: 188: 181: 134: 59: 3934: 803:
include objects with nontrivial destructors. The C++ implementation is free to define the behaviour such that destructors would be called. However, this would preclude some uses of
149: 3415: 819:— when jumping from the lower to the upper call stack in global address space, destructors would be called for every object in the lower call stack. No such issue exists in C. 2794: 1929:
to take effect for C++, and the outcome for C and C++ would be the same. Observe also that the ambiguity in the example above is due to the use of the parenthesis with the
176: 3731: 341: 2904: 321: 2559: 203: 2812: 2585: 1043:
convenience macro. In C++, complex arithmetic can be performed using the complex number class, but the two methods are not code-compatible. (The standards since
1319:
in C is generalized to both built-in and user-defined types by the list initialization syntax of C++11, although with some syntactic and semantic differences.
144: 3723: 334: 54: 2359:"An Overview of the C++ Programming Language in The Handbook of Object Technology (Editor: Saba Zamir). CRC Press LLC, Boca Raton. 1999. ISBN 0-8493-3135-8" 316: 129: 3912: 2603: 1546:
C++ adds numerous additional keywords to support its new features. This renders C code using those keywords for identifiers invalid in C++. For example:
380:
C, and was designed to be mostly source-and-link compatible with C compilers of the time. Due to this, development tools for the two languages (such as
261: 198: 3408: 3635: 2542: 2517: 2471: 1003:, such as complex numbers, variable length arrays (complex numbers and variable length arrays are designated as optional extensions in C11), 1359:// The equivalent in C++ would be X{4, 6}. The C syntactic form used in C99 is supported as an extension in the GCC and Clang C++ compilers. 3650: 3620: 2897: 2834: 3401: 1925:
declaration is placed inside the function: then the presence of an identifier with same name in the function scope inhibits the implicit
3877: 2746: 1683:
inline definitions of the same function in other translation units, all of which can differ. This is a separate consideration from the
44: 33: 3217: 2496: 557:
In order to make the code compile as both C and C++, one must use an explicit cast, as follows (with some caveats in both languages):
381: 2876: 3939: 3640: 3381: 2777: 296: 2730: 3872: 276: 2642: 109: 3198: 3107: 2890: 2444: 971: 954: 938: 291: 2712: 3316: 823: 311: 159: 64: 1611:
There are a few syntactic constructs that are valid in both C and C++ but produce different results in the two languages.
49: 3867: 885:
types must be indicated as such whenever the type is referenced whereas in C++, all declarations of such types carry the
306: 3336: 676: 241: 208: 164: 119: 2577: 3346: 3331: 3037: 430:. On the other hand, C99 reduced some other incompatibilities compared with C89 by incorporating C++ features such as 388:) are often integrated into a single product, with the programmer able to specify C or C++ as their source language. 373: 169: 400:
to be ill-formed C++ code, or to be conforming/well-formed in both languages but to behave differently in C and C++.
3293: 3022: 301: 2743: 1395:// The object is allocated in the stack and its address can be passed to a function. This is not supported in C++. 3823: 3594: 3341: 3047: 2944: 2939: 2934: 1768: 996: 700: 94: 413:
Several additions of C99 are not supported in the current C++ standard or conflicted with C++ features, such as
3660: 3645: 3561: 3546: 3511: 3485: 3321: 3032: 2980: 2913: 2365: 977: 937:, implies that the parameters are unspecified. Therefore, it is legal to call such a function with one or more 362: 218: 213: 139: 2599: 949:, which is also valid in C++. Empty function prototypes are a deprecated feature in C99 (as they were in C89). 1485:// The equivalent in C++ would be using digits = int ; if (memcmp(d, digits{8, 6, 7, 5, 3, 0, 9}, n) == 0) {} 706:
C++ is also more strict in conversions to enums: ints cannot be implicitly converted to enums as in C. Also,
3703: 3693: 3184: 3159: 1252: 655:
C++ has more complicated rules about pointer assignments that add qualifiers as it allows the assignment of
3576: 3536: 3202: 1256: 3144: 449: 3599: 2870: 1196: 1004: 414: 369: 3698: 3584: 3164: 1260: 3887: 3541: 3526: 732:
C++ compilers prohibit goto or switch from crossing an initialization, as in the following C99 code:
2535: 2510: 3630: 3179: 3174: 3136: 3027: 2468: 1716: 827: 236: 3761: 3245: 3010: 2075: 1974: 1962: 1251:
defined in C99 was not included in the C++03 standard, but most mainstream compilers such as the
1020: 808: 671: 114: 3551: 2830: 999:
added several additional features to C that have not been incorporated into standard C++ as of
3895: 3668: 3625: 3078: 3073: 3042: 2985: 2975: 2354: 2331:
is not declared with C linkage and calling conventions, but is being passed to the C function
1697: 1659: 1615: 457: 418: 403: 3556: 3506: 3440: 2617: 3566: 3520: 2673: 2488: 2177: 2079: 223: 3803: 3189: 3149: 3057: 2750: 2475: 1672: 983: 707: 99: 2766: 2690: 2656: 1541:
in C++ whereas C uses a distinct keyword. In C23, the attribute syntax is also supported.
3944: 3844: 3713: 3207: 2726: 718:
in C, whereas they are distinct types in C++ and may have a size different from that of
3362: 3169: 3095: 2995: 1650:
is a signed or unsigned type, whereas for C++ this is compiler implementation specific.
1248: 680: 427: 3678: 3673: 3501: 2634: 667:
while C allows neither of those (although compilers will usually only emit a warning).
3928: 3772: 3589: 3265: 3255: 3194: 1955: 1941:
to be an expression and not a type, and thus the example would not compile with C++.
1720: 87: 2858: 2415: 1806:
is signed or unsigned while in C++ it is always signed to match the underlying type.
822:
C allows for multiple tentative definitions of a single global variable in a single
456:
pointer to be assigned to any pointer type without a cast, while C++ does not; this
3746: 3708: 3683: 3235: 3000: 2704: 72: 3818: 2657:"WG14 N2432 : Remove support for function definitions with identifier lists" 3326: 2000: 800: 2391: 1634:
will generally give different results in the two languages: in C++, it will be
3787: 3615: 2970: 2949: 2082:. Some compilers will produce non-working code if a function pointer declared 812: 77: 2437: 2078:
and calling conventions can also have subtle implications for code that uses
3808: 3756: 1799: 469: 2864: 2438:"C and C++: A Case for Compatibility. The C/C++ Users Journal. August 2002" 1195:
The last member of a C99 structure type with more than one member may be a
703:
generic selection will be used to make C's behaviour more similar to C++'s.
3813: 372:
are closely related but have many significant differences. C++ began as a
3782: 3777: 3751: 3270: 3260: 3240: 3085: 3052: 2990: 2882: 1961:
Depending on the compiler and architecture, it also may be the case that
1491: 1316: 1244: 1012: 1008: 966:, whereas in C the inner struct is also defined outside the outer struct. 465: 423: 385: 281: 271: 266: 82: 3531: 3480: 3475: 3470: 3465: 3460: 3455: 3450: 1538: 1266:
Array parameter qualifiers in functions are supported in C but not C++.
1050:
Variable length arrays. This feature leads to possibly non-compile time
1044: 1000: 2954: 2003:
to maintain both C and C++ compatibility is to make its declaration be
1590:
is valid C code, but is rejected by a C++ compiler, since the keywords
886: 794: 464:
memory allocation, or in the passing of context pointers to the POSIX
3736: 3225: 3122: 3117: 2924: 1052: 396: 377: 17: 2358: 3516: 3445: 3435: 3424: 3311: 1913:
refers to the variable), but C++ allowing it to be omitted (and so
366: 3766: 3741: 3688: 3250: 3230: 3154: 3102: 3090: 987:
types to be declared in function prototypes, whereas C++ does not.
958:
types, but the scope is interpreted differently: in C++, a nested
1646:
will always be a signed expression, regardless of whether or not
3828: 3112: 933:
In C until C23, a function declaration without parameters, e.g.
3397: 2886: 691:
in C, while C++ acts as if there were two overloaded functions
2929: 1032: 992: 407: 2536:"N4659: Working Draft, Standard for Programming Language C++" 2511:"N4659: Working Draft, Standard for Programming Language C++" 2489:"C Dialect Options - Using the GNU Compiler Collection (GCC)" 861:
In C, declaring a new type with the same name as an existing
2469:
Rationale for International Standard—Programming Languages—C
2871:
Oracle (Sun Microsystems) C++ Migration Guide, section 3.11
807:
which would otherwise be valid, such as implementation of
2691:"WG14 N 2841: No function declarators without prototypes" 2392:"C and C++: Siblings. The C/C++ Users Journal. July 2002" 799:
results in undefined behaviour in C++ if the jumped-over
729:
variable must be initialized; in C this is not necessary.
472:. For example, the following is valid in C but not C++: 2861:, sentence by sentence, from a C89 Standard perspective. 1642:. As another consequence of this type difference, in C, 962:
is defined only within the scope/namespace of the outer
2879:, overview by Steve Clamage (ANSI C++ Committee chair). 3393: 2416:"Bjarne Stroustrup's FAQ â€“ Is C a subset of C++?" 1534:
Functions that do not return can be annotated using a
674:
functions to add additional overloaded functions with
2618:"Qualifier-preserving standard library functions, v4" 2180:' C++ compiler, this produces the following warning: 1969:
For these reasons, for C++ code to call a C function
1727:, is introduced as the new Boolean type. The header 448:
One commonly encountered difference is C being more
3886: 3853: 3837: 3796: 3722: 3659: 3608: 3575: 3494: 3355: 3302: 3279: 3216: 3135: 3066: 3009: 2963: 873:is valid, but it is invalid in C++, because in C, 2877:Oracle: Mixing C and C++ Code in the Same Program 1921:). Beware that the outcome is different when the 1653:C++ assigns internal linkage to namespace-scoped 322:Comparison of Visual Basic and Visual Basic .NET 1607:Constructs that behave differently in C and C++ 3935:Comparison of individual programming languages 2086:points to a C++ function that is not declared 2063:/* If this is a C++ compiler, end C linkage */ 2018:/* If this is a C++ compiler, use C linkage */ 1984:. Likewise, for C code to call a C++ function 1657:variables unless they are explicitly declared 1263:provide similar functionality as an extension. 3409: 2898: 2727:"Incompatibilities Between ISO C and ISO C++" 1711:, but they are defined differently. In C++, 452:regarding pointers. Specifically, C allows a 342: 8: 2873:, Oracle/Sun compiler docs on linkage scope. 2578:"FAQ > Casting malloc - Cprogramming.com" 1798:In C it is implementation-defined whether a 1309:// annotates that s is at least 5 chars long 815:switching between separate call stacks with 552:/* Implicit conversion from void* to int* */ 488:/* Implicit conversion from void* to int* */ 2865:Incompatibilities Between ISO C and ISO C++ 2600:"4.4a — Explicit type conversion (casting)" 3416: 3402: 3394: 3015: 2905: 2891: 2883: 2767:"WG14-N2764 : The noreturn attribute" 2349: 2347: 434:comments and mixed declarations and code. 349: 335: 282:ALGOL 68: Comparisons with other languages 272:ALGOL 60: Comparisons with other languages 29: 1958:symbols in the way that C++ compilers do. 1011:keyword, array parameter qualifiers, and 952:In both C and C++, one can define nested 2755:Using the GNU Compiler Collection (GCC) 2606:from the original on 25 September 2016. 2343: 1771:however, whose draft includes changing 1678:: ordinary external definitions (where 1047:require binary compatibility, however.) 292:Comparison of Pascal and Borland Delphi 259: 32: 3636:Resource acquisition is initialization 2783:from the original on 25 December 2022. 1031:primitive data types was added in the 317:Comparison of C# and Visual Basic .NET 2548:from the original on 7 December 2017. 2523:from the original on 7 December 2017. 262:Comparison of Java and .NET platforms 7: 3651:Substitution failure is not an error 3621:Curiously recurring template pattern 468:API, and other frameworks involving 438:Constructs valid in C but not in C++ 3878:Comparison of programming languages 2499:from the original on 26 March 2014. 2371:from the original on 16 August 2012 2033:/* These functions get C linkage */ 1909:in front of structure tags (and so 27:Comparison of programming languages 2733:from the original on 9 April 2006. 2715:from the original on 15 July 2017. 2588:from the original on 5 April 2007. 1767:in C. This is likely to change in 25: 2867:, David R. Tribble (August 2001). 2837:from the original on 3 April 2009 2705:"std::complex - cppreference.com" 2645:from the original on 19 May 2018. 2450:from the original on 22 July 2012 2093:For example, the following code: 1965:differ between the two languages. 663:but not the unsafe assignment to 297:Comparison of Object Pascal and C 3907: 3906: 3376: 3375: 1494:for arrays are valid only in C: 714:enumerators) are always of type 693:const char *strchr(const char *) 267:ALGOL 58's influence on ALGOL 60 1783:to become keywords, and giving 3873:Comparison of ALGOL 68 and C++ 2074:Differences between C and C++ 1894:* C++: return sizeof(struct T) 1288:// equivalent to int *const a 460:appears often in C code using 277:Comparison of ALGOL 68 and C++ 242:List of "Hello World" programs 1: 2478:, revision 5.10 (April 2003). 2007:for the scope of the header: 793:While syntactically valid, a 443:C.1 of the ISO C++ standard. 209:Ternary conditional operator 199:Object-oriented constructors 3669:Comparison of C++ compilers 2674:"2011 ISO C draft standard" 1905:This is due to C requiring 1755:, respectively. Therefore, 1528:// allowed in C, not in C++ 194:Object-oriented programming 3961: 3868:Comparison of Java and C++ 3863:Compatibility of C and C++ 3289:Compatibility of C and C++ 1891:/* C: return sizeof(int) 1723:. In C99, a new keyword, 307:Comparison of Java and C++ 302:Comparison of Pascal and C 287:Compatibility of C and C++ 3904: 3431: 3371: 3018: 2920: 2635:"longjmp - C++ Reference" 1630:in C++, which means that 826:, which is invalid as an 312:Comparison of C# and Java 219:Safe navigation operators 214:Null coalescing operators 3940:C (programming language) 3646:Special member functions 3562:Template metaprogramming 2182: 2095: 2009: 1813: 1696:Both C99 and C++ have a 1638:, while in C it will be 1548: 1495: 1320: 1267: 1200: 1057: 890: 831: 733: 559: 513: 473: 254:Comparison of individual 2012:/* Header file foo.h */ 1917:refers to the implicit 1492:Designated initializers 1253:GNU Compiler Collection 1147:// same as sizeof(int*) 125:Functional instructions 120:Conditional expressions 3294:Comparison with Pascal 2914:C programming language 2831:"Oracle Documentation" 2813:"IBM Knowledge Center" 2795:"IBM Knowledge Center" 2560:"IBM Knowledge Center" 1999:A common practice for 1992:must be declared with 1945:Linking C and C++ code 1005:flexible array members 943:foo(42, "hello world") 415:variable-length arrays 155:Higher-order functions 3704:Oracle Solaris Studio 2749:6 August 2016 at the 1315:The functionality of 1197:flexible array member 708:enumeration constants 370:programming languages 36:programming languages 3732:Comparison of C IDEs 3542:Operator overloading 3527:Function overloading 2582:faq.cprogramming.com 1973:, the C++ code must 1743:that are defined as 1663:, unlike C in which 1257:Microsoft Visual C++ 697:char *strchr(char *) 105:Algebraic data types 3631:One Definition Rule 2859:Detailed comparison 2744:Restricted Pointers 2709:en.cppreference.com 2474:6 June 2016 at the 2208:"test.cc" 2060:#ifdef __cplusplus 2015:#ifdef __cplusplus 1988:, the C++ code for 1963:calling conventions 1954:C compilers do not 237:Evaluation strategy 115:Anonymous functions 3797:Superset languages 3699:Intel C++ Compiler 3517:Exception handling 2355:Stroustrup, Bjarne 1616:Character literals 1261:Intel C++ Compiler 1087:// VLA declaration 1035:standard, via the 1021:Complex arithmetic 830:violation in C++. 672:C standard library 661:const int *const * 189:List comprehension 135:Associative arrays 95:Exception handling 60:Basic instructions 45:General comparison 3920: 3919: 3896:Bjarne Stroustrup 3679:Borland Turbo C++ 3626:Most vexing parse 3567:Virtual functions 3391: 3390: 3131: 3130: 2639:www.cplusplus.com 2602:. 16 April 2015. 2080:function pointers 1626:in C and of type 1317:compound literals 1186:// will print x*2 1013:compound literals 670:C++ changes some 404:Bjarne Stroustrup 376:of an early, pre- 359: 358: 145:String operations 16:(Redirected from 3952: 3910: 3909: 3577:Standard Library 3532:Move constructor 3521:Exception safety 3512:Copy constructor 3418: 3411: 3404: 3395: 3379: 3378: 3016: 3011:Standard library 2907: 2900: 2893: 2884: 2847: 2846: 2844: 2842: 2833:. Docs.sun.com. 2827: 2821: 2820: 2809: 2803: 2802: 2791: 2785: 2784: 2782: 2776:. 21 June 2021. 2771: 2763: 2757: 2741: 2735: 2734: 2723: 2717: 2716: 2701: 2695: 2694: 2687: 2681: 2680: 2678: 2670: 2664: 2663: 2661: 2653: 2647: 2646: 2631: 2625: 2624: 2622: 2614: 2608: 2607: 2596: 2590: 2589: 2574: 2568: 2567: 2556: 2550: 2549: 2547: 2540: 2532: 2526: 2524: 2522: 2515: 2507: 2501: 2500: 2485: 2479: 2466: 2460: 2459: 2457: 2455: 2449: 2442: 2433: 2427: 2426: 2424: 2422: 2412: 2406: 2405: 2403: 2401: 2396: 2387: 2381: 2380: 2378: 2376: 2370: 2363: 2351: 2334: 2330: 2327:This is because 2323: 2320: 2317: 2314: 2311: 2308: 2305: 2302: 2299: 2296: 2293: 2290: 2287: 2284: 2281: 2278: 2275: 2272: 2269: 2266: 2263: 2260: 2257: 2254: 2251: 2248: 2245: 2242: 2239: 2236: 2233: 2230: 2227: 2224: 2221: 2218: 2215: 2212: 2209: 2206: 2205: 2202: 2199: 2196: 2193: 2190: 2187: 2178:Sun Microsystems 2172: 2169: 2168: 2165: 2162: 2159: 2155: 2152: 2149: 2146: 2143: 2142: 2139: 2136: 2133: 2130: 2127: 2124: 2121: 2118: 2115: 2112: 2109: 2105: 2102: 2099: 2089: 2085: 2070: 2067: 2064: 2061: 2058: 2055: 2052: 2049: 2046: 2043: 2040: 2037: 2034: 2031: 2028: 2025: 2022: 2019: 2016: 2013: 2006: 1995: 1991: 1987: 1983: 1979: 1972: 1940: 1936: 1933:operator. Using 1932: 1928: 1924: 1920: 1916: 1912: 1908: 1901: 1898: 1895: 1892: 1889: 1886: 1883: 1880: 1877: 1874: 1871: 1868: 1865: 1862: 1859: 1856: 1853: 1850: 1847: 1844: 1841: 1838: 1835: 1832: 1829: 1826: 1823: 1820: 1817: 1805: 1794: 1790: 1786: 1782: 1778: 1774: 1766: 1762: 1758: 1754: 1750: 1746: 1742: 1738: 1734: 1731:provides macros 1730: 1726: 1721:reserved keyword 1714: 1710: 1706: 1702: 1691: 1681: 1675: 1666: 1662: 1656: 1649: 1645: 1641: 1637: 1633: 1629: 1625: 1621: 1601: 1597: 1593: 1585: 1582: 1579: 1576: 1573: 1570: 1567: 1564: 1561: 1558: 1555: 1552: 1537: 1529: 1526: 1523: 1520: 1517: 1514: 1511: 1508: 1505: 1502: 1499: 1486: 1483: 1480: 1477: 1474: 1471: 1468: 1465: 1462: 1459: 1456: 1453: 1450: 1447: 1444: 1441: 1438: 1435: 1432: 1429: 1426: 1423: 1420: 1417: 1414: 1411: 1408: 1405: 1402: 1399: 1396: 1393: 1390: 1387: 1384: 1381: 1378: 1375: 1372: 1369: 1366: 1363: 1360: 1357: 1354: 1351: 1348: 1345: 1342: 1339: 1336: 1333: 1330: 1327: 1324: 1310: 1307: 1304: 1301: 1298: 1295: 1292: 1289: 1286: 1283: 1280: 1277: 1274: 1271: 1247: 1237: 1234: 1231: 1228: 1225: 1222: 1219: 1216: 1213: 1210: 1207: 1204: 1190: 1187: 1184: 1181: 1178: 1175: 1172: 1169: 1166: 1163: 1160: 1157: 1154: 1151: 1148: 1145: 1142: 1139: 1136: 1133: 1130: 1127: 1124: 1121: 1118: 1115: 1112: 1109: 1106: 1103: 1100: 1097: 1094: 1091: 1088: 1085: 1082: 1079: 1076: 1073: 1070: 1067: 1064: 1061: 1055: 1042: 1038: 1030: 1026: 986: 980: 974: 965: 961: 957: 948: 944: 936: 924: 921: 918: 915: 912: 909: 906: 903: 900: 897: 894: 884: 880: 876: 872: 868: 864: 856: 853: 850: 847: 844: 841: 838: 835: 824:translation unit 818: 806: 797: 788: 785: 782: 779: 776: 773: 770: 767: 764: 761: 758: 755: 752: 749: 746: 743: 740: 737: 728: 721: 717: 713: 698: 694: 690: 686: 679: 666: 662: 658: 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: 553: 550: 547: 544: 541: 538: 535: 532: 529: 526: 523: 520: 517: 507: 504: 501: 498: 495: 492: 489: 486: 483: 480: 477: 463: 455: 433: 426: 351: 344: 337: 224:Modulo operators 150:String functions 100:Enumerated types 30: 21: 3960: 3959: 3955: 3954: 3953: 3951: 3950: 3949: 3925: 3924: 3921: 3916: 3900: 3882: 3856:other languages 3855: 3849: 3833: 3792: 3718: 3655: 3604: 3571: 3490: 3427: 3422: 3392: 3387: 3367: 3351: 3304: 3298: 3282:other languages 3281: 3280:Comparison with 3275: 3212: 3150:Borland Turbo C 3127: 3067:Implementations 3062: 3005: 2959: 2916: 2911: 2855: 2850: 2840: 2838: 2829: 2828: 2824: 2811: 2810: 2806: 2793: 2792: 2788: 2780: 2769: 2765: 2764: 2760: 2751:Wayback Machine 2742: 2738: 2725: 2724: 2720: 2703: 2702: 2698: 2689: 2688: 2684: 2676: 2672: 2671: 2667: 2659: 2655: 2654: 2650: 2633: 2632: 2628: 2620: 2616: 2615: 2611: 2598: 2597: 2593: 2576: 2575: 2571: 2558: 2557: 2553: 2545: 2538: 2534: 2533: 2529: 2520: 2513: 2509: 2508: 2504: 2487: 2486: 2482: 2476:Wayback Machine 2467: 2463: 2453: 2451: 2447: 2440: 2436:B. Stroustrup. 2435: 2434: 2430: 2420: 2418: 2414: 2413: 2409: 2399: 2397: 2394: 2389: 2388: 2384: 2374: 2372: 2368: 2361: 2353: 2352: 2345: 2341: 2332: 2328: 2325: 2324: 2321: 2318: 2315: 2312: 2309: 2306: 2303: 2300: 2297: 2294: 2291: 2288: 2285: 2282: 2279: 2276: 2273: 2270: 2267: 2264: 2261: 2258: 2255: 2252: 2249: 2246: 2243: 2240: 2237: 2234: 2231: 2228: 2225: 2222: 2219: 2216: 2213: 2210: 2207: 2203: 2200: 2197: 2194: 2191: 2188: 2185: 2184: 2174: 2173: 2170: 2166: 2163: 2160: 2157: 2156: 2153: 2150: 2147: 2144: 2140: 2137: 2134: 2131: 2128: 2125: 2122: 2119: 2116: 2113: 2110: 2107: 2106: 2103: 2100: 2097: 2087: 2083: 2072: 2071: 2068: 2065: 2062: 2059: 2056: 2053: 2050: 2047: 2044: 2041: 2038: 2035: 2032: 2029: 2026: 2023: 2020: 2017: 2014: 2011: 2004: 1993: 1989: 1985: 1981: 1977: 1970: 1947: 1938: 1934: 1930: 1926: 1922: 1918: 1914: 1910: 1906: 1903: 1902: 1899: 1896: 1893: 1890: 1887: 1884: 1881: 1878: 1875: 1872: 1869: 1866: 1863: 1860: 1857: 1854: 1851: 1848: 1845: 1842: 1839: 1836: 1833: 1830: 1827: 1824: 1821: 1818: 1815: 1803: 1792: 1788: 1784: 1780: 1776: 1772: 1764: 1760: 1756: 1752: 1748: 1744: 1740: 1736: 1732: 1728: 1724: 1712: 1708: 1704: 1703:with constants 1700: 1689: 1679: 1673: 1664: 1658: 1654: 1647: 1643: 1639: 1635: 1631: 1627: 1623: 1619: 1609: 1599: 1595: 1591: 1587: 1586: 1583: 1580: 1577: 1574: 1571: 1568: 1565: 1562: 1559: 1556: 1553: 1550: 1544: 1535: 1531: 1530: 1527: 1524: 1521: 1518: 1515: 1512: 1509: 1506: 1503: 1500: 1497: 1488: 1487: 1484: 1481: 1478: 1475: 1472: 1469: 1466: 1463: 1460: 1457: 1454: 1451: 1448: 1445: 1442: 1439: 1436: 1433: 1430: 1427: 1424: 1421: 1418: 1415: 1412: 1409: 1406: 1403: 1400: 1397: 1394: 1391: 1388: 1385: 1382: 1379: 1376: 1373: 1370: 1367: 1364: 1361: 1358: 1355: 1352: 1349: 1346: 1343: 1340: 1337: 1334: 1331: 1328: 1325: 1322: 1312: 1311: 1308: 1305: 1302: 1299: 1296: 1293: 1290: 1287: 1284: 1281: 1278: 1275: 1272: 1269: 1243: 1239: 1238: 1235: 1232: 1229: 1226: 1223: 1220: 1217: 1214: 1211: 1208: 1205: 1202: 1192: 1191: 1188: 1185: 1182: 1179: 1176: 1173: 1170: 1167: 1164: 1161: 1158: 1155: 1152: 1149: 1146: 1143: 1140: 1137: 1134: 1131: 1128: 1125: 1122: 1119: 1116: 1113: 1110: 1107: 1104: 1101: 1098: 1095: 1092: 1089: 1086: 1083: 1080: 1077: 1074: 1071: 1068: 1065: 1062: 1059: 1051: 1040: 1036: 1028: 1024: 990: 982: 976: 970: 963: 959: 953: 946: 942: 934: 926: 925: 922: 919: 916: 913: 910: 907: 904: 901: 898: 895: 892: 882: 878: 874: 870: 866: 862: 858: 857: 854: 851: 848: 845: 842: 839: 836: 833: 816: 804: 795: 790: 789: 786: 783: 780: 777: 774: 771: 768: 765: 762: 759: 756: 753: 750: 747: 744: 741: 738: 735: 726: 719: 715: 711: 696: 692: 688: 684: 681:type qualifiers 675: 664: 660: 656: 652: 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: 555: 554: 551: 548: 545: 542: 539: 536: 533: 530: 527: 524: 521: 518: 515: 509: 508: 505: 502: 499: 496: 493: 490: 487: 484: 481: 478: 475: 461: 453: 440: 431: 422: 355: 326: 258: 257: 255: 250: 182:Dependent types 35: 28: 23: 22: 15: 12: 11: 5: 3958: 3956: 3948: 3947: 3942: 3937: 3927: 3926: 3918: 3917: 3905: 3902: 3901: 3899: 3898: 3892: 3890: 3884: 3883: 3881: 3880: 3875: 3870: 3865: 3859: 3857: 3851: 3850: 3848: 3847: 3841: 3839: 3835: 3834: 3832: 3831: 3826: 3821: 3816: 3811: 3806: 3800: 3798: 3794: 3793: 3791: 3790: 3785: 3780: 3775: 3769: 3764: 3759: 3754: 3749: 3744: 3739: 3734: 3728: 3726: 3720: 3719: 3717: 3716: 3711: 3706: 3701: 3696: 3691: 3686: 3681: 3676: 3671: 3665: 3663: 3657: 3656: 3654: 3653: 3648: 3643: 3638: 3633: 3628: 3623: 3618: 3612: 3610: 3606: 3605: 3603: 3602: 3597: 3592: 3590:Smart pointers 3587: 3581: 3579: 3573: 3572: 3570: 3569: 3564: 3559: 3554: 3549: 3544: 3539: 3537:new and delete 3534: 3529: 3524: 3514: 3509: 3504: 3498: 3496: 3492: 3491: 3489: 3488: 3483: 3478: 3473: 3468: 3463: 3458: 3453: 3448: 3443: 3438: 3432: 3429: 3428: 3423: 3421: 3420: 3413: 3406: 3398: 3389: 3388: 3386: 3385: 3372: 3369: 3368: 3366: 3365: 3363:Dennis Ritchie 3359: 3357: 3353: 3352: 3350: 3349: 3344: 3339: 3334: 3329: 3324: 3319: 3314: 3308: 3306: 3300: 3299: 3297: 3296: 3291: 3285: 3283: 3277: 3276: 3274: 3273: 3268: 3263: 3258: 3253: 3248: 3243: 3238: 3233: 3228: 3222: 3220: 3214: 3213: 3211: 3210: 3205: 3192: 3187: 3182: 3177: 3172: 3167: 3162: 3157: 3152: 3147: 3141: 3139: 3133: 3132: 3129: 3128: 3126: 3125: 3120: 3115: 3110: 3105: 3100: 3099: 3098: 3088: 3083: 3082: 3081: 3070: 3068: 3064: 3063: 3061: 3060: 3055: 3050: 3045: 3040: 3038:Dynamic memory 3035: 3030: 3025: 3019: 3013: 3007: 3006: 3004: 3003: 2998: 2993: 2988: 2983: 2978: 2973: 2967: 2965: 2961: 2960: 2958: 2957: 2952: 2947: 2942: 2937: 2932: 2927: 2921: 2918: 2917: 2912: 2910: 2909: 2902: 2895: 2887: 2881: 2880: 2874: 2868: 2862: 2854: 2853:External links 2851: 2849: 2848: 2822: 2804: 2786: 2758: 2736: 2718: 2696: 2682: 2665: 2648: 2626: 2609: 2591: 2569: 2551: 2541:. §Annex C.1. 2527: 2516:. §Annex C.1. 2502: 2480: 2461: 2428: 2407: 2390:B.Stroustrup. 2382: 2342: 2340: 2337: 2183: 2096: 2010: 1967: 1966: 1959: 1946: 1943: 1814: 1808: 1807: 1796: 1694: 1668: 1651: 1608: 1605: 1604: 1603: 1549: 1543: 1542: 1532: 1496: 1489: 1321: 1313: 1268: 1264: 1249:type qualifier 1240: 1201: 1193: 1058: 1048: 1029:double complex 1017: 989: 988: 967: 950: 947:int foo(void); 931: 927: 891: 859: 832: 820: 791: 734: 730: 723: 704: 668: 653: 560: 514: 511:or similarly: 474: 445: 439: 436: 428:type qualifier 421:types and the 419:complex number 391:However, C is 357: 356: 354: 353: 346: 339: 331: 328: 327: 325: 324: 319: 314: 309: 304: 299: 294: 289: 284: 279: 274: 269: 264: 253: 252: 251: 247: 246: 245: 244: 239: 231: 230: 229: 228: 227: 226: 221: 216: 211: 201: 196: 191: 186: 185: 184: 174: 173: 172: 167: 162: 152: 147: 142: 137: 132: 127: 122: 117: 112: 107: 102: 97: 92: 91: 90: 85: 80: 75: 67: 62: 57: 52: 47: 39: 38: 26: 24: 14: 13: 10: 9: 6: 4: 3: 2: 3957: 3946: 3943: 3941: 3938: 3936: 3933: 3932: 3930: 3923: 3915: 3914: 3903: 3897: 3894: 3893: 3891: 3889: 3885: 3879: 3876: 3874: 3871: 3869: 3866: 3864: 3861: 3860: 3858: 3852: 3846: 3843: 3842: 3840: 3836: 3830: 3827: 3825: 3822: 3820: 3817: 3815: 3812: 3810: 3807: 3805: 3804:Objective-C++ 3802: 3801: 3799: 3795: 3789: 3786: 3784: 3781: 3779: 3776: 3774: 3773:Visual Studio 3770: 3768: 3765: 3763: 3760: 3758: 3755: 3753: 3750: 3748: 3745: 3743: 3740: 3738: 3735: 3733: 3730: 3729: 3727: 3725: 3721: 3715: 3712: 3710: 3707: 3705: 3702: 3700: 3697: 3695: 3692: 3690: 3687: 3685: 3682: 3680: 3677: 3675: 3672: 3670: 3667: 3666: 3664: 3662: 3658: 3652: 3649: 3647: 3644: 3642: 3641:Rule of three 3639: 3637: 3634: 3632: 3629: 3627: 3624: 3622: 3619: 3617: 3614: 3613: 3611: 3607: 3601: 3598: 3596: 3593: 3591: 3588: 3586: 3583: 3582: 3580: 3578: 3574: 3568: 3565: 3563: 3560: 3558: 3555: 3553: 3550: 3548: 3545: 3543: 3540: 3538: 3535: 3533: 3530: 3528: 3525: 3522: 3518: 3515: 3513: 3510: 3508: 3505: 3503: 3500: 3499: 3497: 3493: 3487: 3484: 3482: 3479: 3477: 3474: 3472: 3469: 3467: 3464: 3462: 3459: 3457: 3454: 3452: 3449: 3447: 3444: 3442: 3439: 3437: 3434: 3433: 3430: 3426: 3419: 3414: 3412: 3407: 3405: 3400: 3399: 3396: 3384: 3383: 3374: 3373: 3370: 3364: 3361: 3360: 3358: 3354: 3348: 3345: 3343: 3340: 3338: 3335: 3333: 3330: 3328: 3325: 3323: 3320: 3318: 3315: 3313: 3310: 3309: 3307: 3301: 3295: 3292: 3290: 3287: 3286: 3284: 3278: 3272: 3269: 3267: 3266:Visual Studio 3264: 3262: 3259: 3257: 3256:GNOME Builder 3254: 3252: 3249: 3247: 3244: 3242: 3239: 3237: 3234: 3232: 3229: 3227: 3224: 3223: 3221: 3219: 3215: 3209: 3206: 3204: 3200: 3196: 3195:Visual Studio 3193: 3191: 3188: 3186: 3183: 3181: 3178: 3176: 3173: 3171: 3168: 3166: 3163: 3161: 3158: 3156: 3153: 3151: 3148: 3146: 3143: 3142: 3140: 3138: 3134: 3124: 3121: 3119: 3116: 3114: 3111: 3109: 3106: 3104: 3101: 3097: 3094: 3093: 3092: 3089: 3087: 3084: 3080: 3077: 3076: 3075: 3072: 3071: 3069: 3065: 3059: 3056: 3054: 3051: 3049: 3046: 3044: 3041: 3039: 3036: 3034: 3031: 3029: 3026: 3024: 3021: 3020: 3017: 3014: 3012: 3008: 3002: 2999: 2997: 2994: 2992: 2989: 2987: 2984: 2982: 2979: 2977: 2974: 2972: 2969: 2968: 2966: 2962: 2956: 2953: 2951: 2948: 2946: 2943: 2941: 2938: 2936: 2933: 2931: 2928: 2926: 2923: 2922: 2919: 2915: 2908: 2903: 2901: 2896: 2894: 2889: 2888: 2885: 2878: 2875: 2872: 2869: 2866: 2863: 2860: 2857: 2856: 2852: 2836: 2832: 2826: 2823: 2818: 2814: 2808: 2805: 2800: 2796: 2790: 2787: 2779: 2775: 2768: 2762: 2759: 2756: 2752: 2748: 2745: 2740: 2737: 2732: 2728: 2722: 2719: 2714: 2710: 2706: 2700: 2697: 2692: 2686: 2683: 2675: 2669: 2666: 2658: 2652: 2649: 2644: 2640: 2636: 2630: 2627: 2619: 2613: 2610: 2605: 2601: 2595: 2592: 2587: 2583: 2579: 2573: 2570: 2565: 2561: 2555: 2552: 2544: 2537: 2531: 2528: 2519: 2512: 2506: 2503: 2498: 2494: 2490: 2484: 2481: 2477: 2473: 2470: 2465: 2462: 2446: 2439: 2432: 2429: 2417: 2411: 2408: 2393: 2386: 2383: 2367: 2364:. p. 4. 2360: 2356: 2350: 2348: 2344: 2338: 2336: 2329:my_function() 2289:"C" 2256:"C" 2181: 2179: 2111:"C" 2094: 2091: 2081: 2077: 2024:"C" 2008: 2002: 1997: 1976: 1964: 1960: 1957: 1953: 1952: 1951: 1944: 1942: 1937:would expect 1812: 1801: 1797: 1770: 1722: 1718: 1717:built-in type 1699: 1695: 1686: 1677: 1669: 1661: 1652: 1617: 1614: 1613: 1612: 1606: 1602:are reserved. 1589: 1588: 1547: 1540: 1533: 1493: 1490: 1318: 1314: 1265: 1262: 1258: 1254: 1250: 1246: 1241: 1198: 1194: 1054: 1049: 1046: 1034: 1025:float complex 1022: 1019: 1018: 1016: 1014: 1010: 1006: 1002: 998: 994: 985: 979: 973: 968: 956: 951: 940: 932: 928: 888: 860: 829: 825: 821: 814: 810: 802: 798: 792: 731: 724: 709: 705: 702: 682: 678: 673: 669: 654: 558: 512: 471: 467: 459: 451: 447: 446: 444: 437: 435: 429: 425: 420: 416: 411: 409: 405: 401: 398: 394: 389: 387: 383: 379: 375: 371: 368: 364: 352: 347: 345: 340: 338: 333: 332: 330: 329: 323: 320: 318: 315: 313: 310: 308: 305: 303: 300: 298: 295: 293: 290: 288: 285: 283: 280: 278: 275: 273: 270: 268: 265: 263: 260: 249: 248: 243: 240: 238: 235: 234: 233: 232: 225: 222: 220: 217: 215: 212: 210: 207: 206: 205: 202: 200: 197: 195: 192: 190: 187: 183: 180: 179: 178: 175: 171: 168: 166: 163: 161: 158: 157: 156: 153: 151: 148: 146: 143: 141: 138: 136: 133: 131: 128: 126: 123: 121: 118: 116: 113: 111: 108: 106: 103: 101: 98: 96: 93: 89: 86: 84: 81: 79: 76: 74: 73:Foreach loops 71: 70: 69:Control flow 68: 66: 63: 61: 58: 56: 53: 51: 48: 46: 43: 42: 41: 40: 37: 34:Comparison of 31: 19: 3922: 3911: 3862: 3845:Embedded C++ 3747:Code::Blocks 3714:Watcom C/C++ 3380: 3288: 3236:Code::Blocks 3208:Watcom C/C++ 2996:Preprocessor 2976:Header files 2839:. Retrieved 2825: 2816: 2807: 2798: 2789: 2774:open-std.org 2773: 2761: 2754: 2739: 2721: 2708: 2699: 2685: 2668: 2651: 2638: 2629: 2612: 2594: 2581: 2572: 2563: 2554: 2530: 2505: 2492: 2483: 2464: 2452:. Retrieved 2431: 2421:22 September 2419:. Retrieved 2410: 2398:. Retrieved 2385: 2373:. Retrieved 2326: 2175: 2092: 2073: 2001:header files 1998: 1968: 1948: 1904: 1809: 1698:Boolean type 1684: 1622:are of type 1610: 1545: 1039:keyword and 991: 889:implicitly. 801:stack frames 665:const int ** 556: 510: 450:weakly-typed 441: 412: 402: 392: 390: 378:standardized 360: 286: 177:Type systems 55:Basic syntax 3854:Relative to 3674:Borland C++ 3585:I/O Streams 3327:Objective-C 3108:Windows CRT 2229:Anachronism 2164:my_function 2101:my_function 1956:name mangle 1640:sizeof(int) 1522:'g' 1513:'a' 78:While loops 3929:Categories 3788:Qt Creator 3771:Microsoft 3709:Visual C++ 3684:C++Builder 3616:As-if rule 3552:References 3303:Descendant 3175:Norcroft C 3001:Data types 2950:Embedded C 2339:References 2088:extern "C" 2084:extern "C" 2005:extern "C" 1994:extern "C" 1982:extern "C" 1763:have type 1632:sizeof 'a' 1056:operator. 1023:using the 935:int foo(); 813:coroutines 110:Generators 50:Assignment 3819:C++/WinRT 3661:Compilers 3557:Templates 3547:Operators 3486:Libraries 3305:languages 3137:Compilers 3079:libhybris 2981:Operators 2971:Functions 2841:18 August 2454:18 August 2375:12 August 2054:/* ... */ 1975:prototype 1915:sizeof(T) 1911:sizeof(T) 1800:bit field 1791:the type 1729:stdbool.h 1676:functions 1539:attribute 1165:"%zu 1126:"%zu 969:C allows 939:arguments 817:longjmp() 805:longjmp() 796:longjmp() 725:In C++ a 470:callbacks 417:, native 386:compilers 256:languages 204:Operators 83:For loops 3913:Category 3888:Designer 3838:Dialects 3783:KDevelop 3778:NetBeans 3752:CodeLite 3507:Concepts 3495:Features 3382:Category 3356:Designer 3271:NetBeans 3261:KDevelop 3241:CodeLite 3086:dietlibc 3053:Variadic 3028:File I/O 2964:Features 2835:Archived 2778:Archived 2747:Archived 2731:Archived 2713:Archived 2643:Archived 2604:Archived 2586:Archived 2543:Archived 2518:Archived 2497:Archived 2472:Archived 2445:Archived 2400:17 March 2366:Archived 2241:argument 1935:sizeof T 1802:of type 1618:such as 1592:template 1572:template 1554:template 1536:noreturn 1245:restrict 1037:_Complex 1009:restrict 687:returns 466:pthreads 424:restrict 88:Do-while 65:Comments 3809:C++/CLI 3762:Eclipse 3757:Dev-C++ 3600:Strings 3502:Classes 3441:Outline 3246:Eclipse 3199:Express 2955:MISRA C 2817:ibm.com 2799:ibm.com 2564:ibm.com 2493:gnu.org 2223:Warning 2076:linkage 1927:typedef 1919:typedef 1685:linkage 1041:complex 941:, e.g. 914:typedef 887:typedef 809:threads 683:, e.g. 3814:C++/CX 3737:Anjuta 3226:Anjuta 3123:uClibc 3118:Newlib 3096:EGLIBC 3074:Bionic 3043:String 2991:Syntax 2986:String 2925:ANSI C 2310:passed 2286:extern 2253:extern 2244:fn_ptr 2238:Formal 2176:Using 2132:fn_ptr 2108:extern 2069:#endif 2045:struct 2030:#endif 2021:extern 1931:sizeof 1923:extern 1907:struct 1879:sizeof 1876:return 1846:struct 1816:extern 1779:, and 1719:and a 1690:inline 1680:extern 1674:inline 1665:extern 1660:extern 1569:struct 1551:struct 1404:memcmp 1374:struct 1338:struct 1323:struct 1259:, and 1203:struct 1177:sizeof 1171:" 1159:printf 1138:sizeof 1132:" 1120:printf 1099:size_t 1069:size_t 1053:sizeof 1007:, the 981:, and 972:struct 964:struct 960:struct 955:struct 881:, and 875:struct 863:struct 695:and a 685:strchr 657:int ** 640:sizeof 628:malloc 540:sizeof 528:malloc 462:malloc 397:subset 160:Filter 130:Arrays 3767:Geany 3742:CLion 3689:Clang 3609:Ideas 3481:C++26 3476:C++23 3471:C++20 3466:C++17 3461:C++14 3456:C++11 3451:C++03 3446:C++98 3337:Limbo 3251:Geany 3231:CLion 3155:Clang 3103:klibc 3091:glibc 3058:POSIX 2781:(PDF) 2770:(PDF) 2753:from 2677:(PDF) 2660:(PDF) 2621:(PDF) 2546:(PDF) 2539:(PDF) 2521:(PDF) 2514:(PDF) 2448:(PDF) 2441:(PDF) 2395:(PDF) 2369:(PDF) 2362:(PDF) 2333:foo() 2307:being 1990:bar() 1986:bar() 1980:with 1978:foo() 1971:foo() 1789:false 1781:false 1761:false 1745:_Bool 1741:false 1725:_Bool 1715:is a 1709:false 1655:const 1600:class 1578:class 1368:& 1230:bytes 1045:C++11 1001:C++20 978:union 902:FALSE 879:union 867:union 778:flack 757:flack 727:const 699:. In 689:char* 677:const 458:idiom 454:void* 140:Scope 18:C/C++ 3829:SYCL 3724:IDEs 3347:Vala 3332:Alef 3218:IDEs 3185:SDCC 3113:musl 3048:Time 3033:Math 3023:Char 2843:2013 2456:2013 2423:2019 2402:2019 2377:2009 2322:)(). 2313:void 2301:)()) 2292:void 2274:call 2259:void 2250:type 2214:line 2198:test 2145:void 2138:void 2123:void 2114:void 2098:void 2036:void 1837:void 1831:size 1793:bool 1787:and 1785:true 1777:true 1773:bool 1759:and 1757:true 1751:and 1739:and 1737:true 1733:bool 1713:bool 1707:and 1705:true 1701:bool 1693:C++. 1648:char 1628:char 1598:and 1498:char 1300:char 1242:The 1227:char 1150:char 1090:void 1060:void 1027:and 995:and 984:enum 920:BOOL 908:TRUE 896:BOOL 893:enum 883:enum 871:enum 754:goto 745:void 736:void 712:enum 562:void 476:void 384:and 382:IDEs 374:fork 365:and 361:The 165:Fold 3945:C++ 3694:GCC 3595:STL 3436:C++ 3425:C++ 3312:C++ 3203:C++ 3190:TCC 3180:PCC 3170:LCC 3165:ICC 3160:GCC 3145:ACK 2945:C23 2940:C17 2935:C11 2930:C99 2280:foo 2268:)() 2158:foo 2148:bar 2141:)); 2117:foo 2104:(); 2048:bar 2042:(); 2039:foo 1864:int 1855:int 1828:int 1819:int 1804:int 1769:C23 1765:int 1644:'a' 1624:int 1620:'a' 1596:new 1563:new 1560:int 1419:int 1392:}); 1362:foo 1294:bar 1291:int 1279:int 1273:foo 1270:int 1212:int 1108:int 1093:foo 1078:int 1063:foo 1033:C99 1015:. 997:C11 993:C99 917:int 869:or 843:int 834:int 828:ODR 811:or 763:int 720:int 716:int 701:C23 659:to 619:int 604:int 598:ptr 589:int 574:int 568:ptr 516:int 503:ptr 491:int 482:ptr 408:C99 393:not 367:C++ 170:Map 3931:: 3824:Ch 3342:Go 3317:C# 3201:, 3197:, 2815:. 2797:. 2772:. 2729:. 2711:. 2707:. 2641:. 2637:. 2584:. 2580:. 2562:. 2495:. 2491:. 2443:. 2357:. 2346:^ 2335:. 2304:is 2277:to 2271:in 2247:of 2204:cc 2189:CC 2186:$ 2167:); 2151:() 2135:)( 2090:. 2057:}; 1996:. 1897:*/ 1888:); 1873:}; 1775:, 1747:, 1735:, 1594:, 1584:}; 1525:}; 1482:{} 1473:== 1464:}, 1422:){ 1398:if 1380:){ 1356:}; 1344:){ 1306:); 1285:); 1255:, 1183:); 1168:\n 1144:); 1129:\n 1084:); 975:, 911:}; 877:, 865:, 852:10 739:fn 649:); 549:); 432:// 395:a 3523:) 3519:( 3417:e 3410:t 3403:v 3322:D 2906:e 2899:t 2892:v 2845:. 2819:. 2801:. 2693:. 2679:. 2662:. 2623:. 2566:. 2458:. 2425:. 2404:. 2379:. 2319:* 2316:( 2298:* 2295:( 2283:( 2265:* 2262:( 2235:: 2232:) 2226:( 2220:: 2217:6 2211:, 2201:. 2195:c 2192:- 2171:} 2161:( 2154:{ 2129:* 2126:( 2120:( 2066:} 2051:{ 2027:{ 1939:T 1900:} 1885:T 1882:( 1870:; 1867:j 1861:; 1858:i 1852:{ 1849:T 1843:{ 1840:) 1834:( 1825:; 1822:T 1795:. 1753:0 1749:1 1636:1 1581:; 1575:* 1566:; 1557:{ 1519:= 1516:, 1510:= 1507:{ 1504:= 1501:s 1479:) 1476:0 1470:) 1467:n 1461:9 1458:, 1455:0 1452:, 1449:3 1446:, 1443:5 1440:, 1437:7 1434:, 1431:6 1428:, 1425:8 1416:( 1413:, 1410:d 1407:( 1401:( 1389:6 1386:, 1383:4 1377:X 1371:( 1365:( 1353:6 1350:, 1347:4 1341:X 1335:( 1332:= 1329:a 1326:X 1303:s 1297:( 1282:a 1276:( 1236:} 1233:; 1224:; 1221:m 1218:, 1215:n 1209:{ 1206:X 1189:} 1180:s 1174:, 1162:( 1156:; 1153:s 1141:a 1135:, 1123:( 1117:{ 1114:) 1111:a 1105:, 1102:x 1096:( 1081:a 1075:, 1072:x 1066:( 923:; 905:, 899:{ 855:; 849:= 846:N 840:; 837:N 787:} 784:; 781:: 775:; 772:1 769:= 766:i 760:; 751:{ 748:) 742:( 722:. 710:( 646:j 643:* 637:* 634:5 631:( 625:) 622:* 616:( 613:= 610:j 607:* 601:; 595:) 592:* 586:( 583:= 580:i 577:* 571:; 565:* 546:j 543:* 537:* 534:5 531:( 525:= 522:j 519:* 506:; 500:= 497:i 494:* 485:; 479:* 363:C 350:e 343:t 336:v 20:)

Index

C/C++
Comparison of
programming languages

General comparison
Assignment
Basic syntax
Basic instructions
Comments
Foreach loops
While loops
For loops
Do-while
Exception handling
Enumerated types
Algebraic data types
Generators
Anonymous functions
Conditional expressions
Functional instructions
Arrays
Associative arrays
Scope
String operations
String functions
Higher-order functions
Filter
Fold
Map
Type systems
Dependent types
List comprehension

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

↑