<!DOCTYPE html>
<html class="client-nojs vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-0 vector-toc-not-available vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-0 skin-theme-clientpref-os vector-sticky-header-enabled" lang="en" dir="ltr"><head>
    <meta charset="UTF-8">
    <title>Assert.h</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="icon" type="image/png" href="./_res_/favicon.png">
    <link rel="canonical" href="https://en.wikipedia.org/wiki/Assert.h"> <link href="./_mw_/ext.cite.styles.css" rel="stylesheet" type="text/css">
    <link href="./_mw_/ext.pygments.css" rel="stylesheet" type="text/css">
    <link href="./_mw_/ext.wikimediamessages.styles.css" rel="stylesheet" type="text/css">
    <link href="./_mw_/skins.vector.icons.css" rel="stylesheet" type="text/css">
    <link href="./_mw_/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
    <link href="./_mw_/skins.vector.styles.css" rel="stylesheet" type="text/css">
    <meta name="ResourceLoaderDynamicStyles" content="">
    
    <link rel="stylesheet" type="text/css" href="./_mw_/site.styles.css">
    <link rel="stylesheet" type="text/css" href="./_mw_/noscript.css">
    <link rel="stylesheet" type="text/css" href="./_res_/footer.css">
    <link rel="stylesheet" type="text/css" href="./_res_/vector-2022.css">
  </head>
  <body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Assert_h rootpage-Assert_h skin-vector-2022 action-view">
    <div class="mw-page-container">
      <div class="mw-page-container-inner">
        <div class="mw-content-container">
          <main id="content" class="mw-body">
            <header class="mw-body-header vector-page-titlebar">
              <h1 id="firstHeading" class="firstHeading mw-first-heading">assert.h</h1>
            </header>
            <a id="top"></a>
            <div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
              <div id="contentSub">
                <div id="mw-content-subtitle"></div>
              </div>
              <div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr">
<style data-mw-deduplicate="TemplateStyles:r1333133064">
/* start https://en.wikipedia.org/ */


.mw-parser-output .hlist dl,.mw-parser-output .hlist ol,.mw-parser-output .hlist ul{margin:0;padding:0}.mw-parser-output .hlist dd,.mw-parser-output .hlist dt,.mw-parser-output .hlist li{margin:0;display:inline}.mw-parser-output .hlist.inline,.mw-parser-output .hlist.inline dl,.mw-parser-output .hlist.inline ol,.mw-parser-output .hlist.inline ul,.mw-parser-output .hlist dl dl,.mw-parser-output .hlist dl ol,.mw-parser-output .hlist dl ul,.mw-parser-output .hlist ol dl,.mw-parser-output .hlist ol ol,.mw-parser-output .hlist ol ul,.mw-parser-output .hlist ul dl,.mw-parser-output .hlist ul ol,.mw-parser-output .hlist ul ul{display:inline}.mw-parser-output .hlist .mw-empty-li{display:none}.mw-parser-output .hlist dt::after{content:": "}.mw-parser-output .hlist dd::after,.mw-parser-output .hlist li::after{content:"\a0 · ";font-weight:bold}.mw-parser-output .hlist dd:last-child::after,.mw-parser-output .hlist dt:last-child::after,.mw-parser-output .hlist li:last-child::after{content:none}.mw-parser-output .hlist dd dd:first-child::before,.mw-parser-output .hlist dd dt:first-child::before,.mw-parser-output .hlist dd li:first-child::before,.mw-parser-output .hlist dt dd:first-child::before,.mw-parser-output .hlist dt dt:first-child::before,.mw-parser-output .hlist dt li:first-child::before,.mw-parser-output .hlist li dd:first-child::before,.mw-parser-output .hlist li dt:first-child::before,.mw-parser-output .hlist li li:first-child::before{content:" (";font-weight:normal}.mw-parser-output .hlist dd dd:last-child::after,.mw-parser-output .hlist dd dt:last-child::after,.mw-parser-output .hlist dd li:last-child::after,.mw-parser-output .hlist dt dd:last-child::after,.mw-parser-output .hlist dt dt:last-child::after,.mw-parser-output .hlist dt li:last-child::after,.mw-parser-output .hlist li dd:last-child::after,.mw-parser-output .hlist li dt:last-child::after,.mw-parser-output .hlist li li:last-child::after{content:")";font-weight:normal}.mw-parser-output .hlist ol{counter-reset:listitem}.mw-parser-output .hlist ol>li{counter-increment:listitem}.mw-parser-output .hlist ol>li::before{content:" "counter(listitem)"\a0 "}.mw-parser-output .hlist dd ol>li:first-child::before,.mw-parser-output .hlist dt ol>li:first-child::before,.mw-parser-output .hlist li ol>li:first-child::before{content:" ("counter(listitem)"\a0 "}


/* end   https://en.wikipedia.org/ */
</style><style data-mw-deduplicate="TemplateStyles:r1246091330">
/* start https://en.wikipedia.org/ */


.mw-parser-output .sidebar{width:22em;float:right;clear:right;margin:0.5em 0 1em 1em;background:var(--background-color-neutral-subtle,#f8f9fa);border:1px solid var(--border-color-base,#a2a9b1);padding:0.2em;text-align:center;line-height:1.4em;font-size:88%;border-collapse:collapse;display:table}body.skin-minerva .mw-parser-output .sidebar{display:table!important;float:right!important;margin:0.5em 0 1em 1em!important}.mw-parser-output .sidebar-subgroup{width:100%;margin:0;border-spacing:0}.mw-parser-output .sidebar-left{float:left;clear:left;margin:0.5em 1em 1em 0}.mw-parser-output .sidebar-none{float:none;clear:both;margin:0.5em 1em 1em 0}.mw-parser-output .sidebar-outer-title{padding:0 0.4em 0.2em;font-size:125%;line-height:1.2em;font-weight:bold}.mw-parser-output .sidebar-top-image{padding:0.4em}.mw-parser-output .sidebar-top-caption,.mw-parser-output .sidebar-pretitle-with-top-image,.mw-parser-output .sidebar-caption{padding:0.2em 0.4em 0;line-height:1.2em}.mw-parser-output .sidebar-pretitle{padding:0.4em 0.4em 0;line-height:1.2em}.mw-parser-output .sidebar-title,.mw-parser-output .sidebar-title-with-pretitle{padding:0.2em 0.8em;font-size:145%;line-height:1.2em}.mw-parser-output .sidebar-title-with-pretitle{padding:0.1em 0.4em}.mw-parser-output .sidebar-image{padding:0.2em 0.4em 0.4em}.mw-parser-output .sidebar-heading{padding:0.1em 0.4em}.mw-parser-output .sidebar-content{padding:0 0.5em 0.4em}.mw-parser-output .sidebar-content-with-subgroup{padding:0.1em 0.4em 0.2em}.mw-parser-output .sidebar-above,.mw-parser-output .sidebar-below{padding:0.3em 0.8em;font-weight:bold}.mw-parser-output .sidebar-collapse .sidebar-above,.mw-parser-output .sidebar-collapse .sidebar-below{border-top:1px solid #aaa;border-bottom:1px solid #aaa}.mw-parser-output .sidebar-navbar{text-align:right;font-size:115%;padding:0 0.4em 0.4em}.mw-parser-output .sidebar-list-title{padding:0 0.4em;text-align:left;font-weight:bold;line-height:1.6em;font-size:105%}.mw-parser-output .sidebar-list-title-c{padding:0 0.4em;text-align:center;margin:0 3.3em}@media(max-width:640px){body.mediawiki .mw-parser-output .sidebar{width:100%!important;clear:both;float:none!important;margin-left:0!important;margin-right:0!important}}body.skin--responsive .mw-parser-output .sidebar a>img{max-width:none!important}@media screen{html.skin-theme-clientpref-night .mw-parser-output .sidebar:not(.notheme) .sidebar-list-title,html.skin-theme-clientpref-night .mw-parser-output .sidebar:not(.notheme) .sidebar-title-with-pretitle{background:transparent!important}html.skin-theme-clientpref-night .mw-parser-output .sidebar:not(.notheme) .sidebar-title-with-pretitle a{color:var(--color-progressive)!important}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .sidebar:not(.notheme) .sidebar-list-title,html.skin-theme-clientpref-os .mw-parser-output .sidebar:not(.notheme) .sidebar-title-with-pretitle{background:transparent!important}html.skin-theme-clientpref-os .mw-parser-output .sidebar:not(.notheme) .sidebar-title-with-pretitle a{color:var(--color-progressive)!important}}@media print{body.ns-0 .mw-parser-output .sidebar{display:none!important}}


/* end   https://en.wikipedia.org/ */
</style><style data-mw-deduplicate="TemplateStyles:r1238254908">
/* start https://en.wikipedia.org/ */


.mw-parser-output .c-standard-library .sidebar-content{text-align:left}


/* end   https://en.wikipedia.org/ */
</style><style data-mw-deduplicate="TemplateStyles:r886049734">
/* start https://en.wikipedia.org/ */


.mw-parser-output .monospaced{font-family:monospace,monospace}


/* end   https://en.wikipedia.org/ */
</style><table class="sidebar nomobile nowraplinks c-standard-library" role="navigation"><tbody><tr><th class="sidebar-title"><a href="C_standard_library" title="C standard library">C standard library</a> (libc)</th></tr><tr><th class="sidebar-heading">
General topics</th></tr><tr><td class="sidebar-content">
<ul><li><a href="C_data_types" title="C data types">Data types</a></li>
<li><a href="C_character_classification" title="C character classification">Character classification</a></li>
<li><a href="C_string_handling" title="C string handling">Strings</a></li>
<li><a href="C_mathematical_functions" title="C mathematical functions">Mathematics</a></li>
<li><a href="C_file_input/output" title="C file input/output">File input/output</a></li>
<li><a href="C_date_and_time_functions" title="C date and time functions">Date/time</a></li>
<li><a href="C_localization_functions" title="C localization functions">Localization</a></li>
<li><a href="C_dynamic_memory_allocation" title="C dynamic memory allocation">Memory allocation</a></li>
<li><a href="C_process_control" title="C process control">Process control</a></li>
<li><a href="C_signal_handling" title="C signal handling">Signals</a></li>
<li><a href="C_alternative_tokens" title="C alternative tokens">Alternative tokens</a></li></ul></td>
</tr><tr><th class="sidebar-heading">
Miscellaneous headers</th></tr><tr><td class="sidebar-content">
<ul><li><span class="monospaced">&lt;<a class="mw-selflink selflink">assert.h</a>&gt;</span></li>
<li><span class="monospaced">&lt;<a href="Errno.h" title="Errno.h">errno.h</a>&gt;</span></li>
<li><span class="monospaced">&lt;<a href="Setjmp.h" title="Setjmp.h">setjmp.h</a>&gt;</span></li>
<li><span class="monospaced">&lt;<a href="Stdarg.h" title="Stdarg.h">stdarg.h</a>&gt;</span></li></ul></td>
</tr><tr><td class="sidebar-navbar"><style data-mw-deduplicate="TemplateStyles:r1239400231">
/* start https://en.wikipedia.org/ */


.mw-parser-output .navbar{display:inline;font-size:88%;font-weight:normal}.mw-parser-output .navbar-collapse{float:left;text-align:left}.mw-parser-output .navbar-boxtext{word-spacing:0}.mw-parser-output .navbar ul{display:inline-block;white-space:nowrap;line-height:inherit}.mw-parser-output .navbar-brackets::before{margin-right:-0.125em;content:"[ "}.mw-parser-output .navbar-brackets::after{margin-left:-0.125em;content:" ]"}.mw-parser-output .navbar li{word-spacing:-0.125em}.mw-parser-output .navbar a>span,.mw-parser-output .navbar a>abbr{text-decoration:inherit}.mw-parser-output .navbar-mini abbr{font-variant:small-caps;border-bottom:none;text-decoration:none;cursor:inherit}.mw-parser-output .navbar-ct-full{font-size:114%;margin:0 7em}.mw-parser-output .navbar-ct-mini{font-size:114%;margin:0 4em}html.skin-theme-clientpref-night .mw-parser-output .navbar li a abbr{color:var(--color-base)!important}@media(prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .navbar li a abbr{color:var(--color-base)!important}}@media print{.mw-parser-output .navbar{display:none!important}}


/* end   https://en.wikipedia.org/ */
</style></td></tr></tbody></table>
<p><b><span class="monospaced">&lt;assert.h&gt;</span></b> is a <a href="Header_file" class="mw-redirect" title="Header file">header file</a> in the <a href="C_standard_library" title="C standard library">C standard library</a>. It defines the <a href="C_preprocessor" title="C preprocessor">C preprocessor</a> <a href="Macro_(computer_science)" title="Macro (computer science)">macro</a> <code class="mw-highlight mw-highlight-lang-c mw-content-ltr" dir="ltr"><span class="n">assert</span></code> and implements runtime <a href="Assertion_(software_development)" title="Assertion (software development)">assertion</a> in C.
</p><p><code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">&lt;assert.h&gt;</code> is defined in <a href="ANSI_C" title="ANSI C">ANSI C</a> as part of the C standard library. In the <a href="C%2B%2B" title="C++">C++</a> programming language, <code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">&lt;assert.h&gt;</code> and <code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">&lt;cassert&gt;</code> are available; both are functionally equivalent.<sup id="cite_ref-FOOTNOTEBinder2000860_1-0" class="reference"><a href="#cite_note-FOOTNOTEBinder2000860-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup>
</p>

<div class="mw-heading mw-heading2"><h2 id="Use">Use</h2></div>
<p>The <code class="mw-highlight mw-highlight-lang-c mw-content-ltr" dir="ltr"><span class="n">assert</span></code> macro implements runtime assertion. If the expression within it is false, the macro will print a message to <code><a href="Stderr" class="mw-redirect" title="Stderr">stderr</a></code> and call <code><a href="C_process_control#abort" title="C process control">abort()</a></code>, defined in <span class="monospaced"><a href="Stdlib.h" class="mw-redirect" title="Stdlib.h">&lt;stdlib.h&gt;</a></span>. The message includes the source filename and the source line number from the macros <code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">__FILE__</code> and <code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">__LINE__</code>, respectively.<sup id="cite_ref-FOOTNOTEKernighanRitchie1988253-254_2-0" class="reference"><a href="#cite_note-FOOTNOTEKernighanRitchie1988253-254-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> Since <a href="C99" title="C99">C99</a>, the name of the function the assert statement is included as (<code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">__FUNC__</code>) and the expression itself.<sup id="cite_ref-FOOTNOTEISO/IEC_JTC_1/SC_22/WG141999169_3-0" class="reference"><a href="#cite_note-FOOTNOTEISO/IEC_JTC_1/SC_22/WG141999169-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup> In ANSI C, the expression in the <code class="mw-highlight mw-highlight-lang-c mw-content-ltr" dir="ltr"><span class="n">assert</span></code> macro is defined as <a href="Signed_integer" class="mw-redirect" title="Signed integer">signed integer</a>, although any expression that can be implicitly cast to a signed integer may be used. In C99, the <code class="mw-highlight mw-highlight-lang-c mw-content-ltr" dir="ltr"><span class="n">assert</span></code> macro explicitly allows any <a href="Scalar_(computing)" class="mw-redirect" title="Scalar (computing)">scalar</a> type.<sup id="cite_ref-4" class="reference"><a href="#cite_note-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup> Two common uses of the <code class="mw-highlight mw-highlight-lang-c mw-content-ltr" dir="ltr"><span class="n">assert</span></code> macro are to assert that a <a href="Pointer_(computer_programming)" title="Pointer (computer programming)">pointer</a> is not null and to ensure that an array index is in-bounds.<sup id="cite_ref-5" class="reference"><a href="#cite_note-5"><span class="cite-bracket">[</span>5<span class="cite-bracket">]</span></a></sup>
</p><p>Below is a program using the <code class="mw-highlight mw-highlight-lang-c mw-content-ltr" dir="ltr"><span class="n">assert</span></code> macro. This program will always evaluate <code class="mw-highlight mw-highlight-lang-c mw-content-ltr" dir="ltr"><span class="n">pointer</span></code> as false, as <code class="mw-highlight mw-highlight-lang-c mw-content-ltr" dir="ltr"><span class="n">pointer</span></code> is a <a href="Null_pointer" title="Null pointer">null pointer</a> and does not point to a valid <a href="Memory_location" class="mw-redirect" title="Memory location">memory location</a>:
</p>
<div class="mw-highlight mw-highlight-lang-c mw-content-ltr" dir="ltr"><pre><span></span><span class="cp">#include</span><span class="w"> </span><span class="cpf">&lt;assert.h&gt;</span>
<span class="cp">#include</span><span class="w"> </span><span class="cpf">&lt;stddef.h&gt;</span>

<span class="kt">int</span><span class="w"> </span><span class="nf">main</span><span class="p">()</span><span class="w"> </span><span class="p">{</span>
<span class="w">    </span><span class="kt">void</span><span class="o">*</span><span class="w"> </span><span class="n">ptr</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nb">NULL</span><span class="p">;</span>
<span class="w">    </span><span class="n">assert</span><span class="p">(</span><span class="n">ptr</span><span class="p">);</span>
<span class="w">    </span><span class="k">return</span><span class="w"> </span><span class="mi">0</span><span class="p">;</span>
<span class="p">}</span>
</pre></div>
<p>Upon compiling the program and running it, a message similar to the following will be output:
</p>
<div class="mw-highlight mw-highlight-lang-output mw-content-ltr" dir="ltr"><pre><span></span><span class="go">program: source.c:5: main: Assertion 'ptr' failed.</span>
<span class="go">Aborted (core dumped)</span>
</pre></div>
<p>The definition of the <code class="mw-highlight mw-highlight-lang-c mw-content-ltr" dir="ltr"><span class="n">assert</span></code> macro changes depending on the definition of another macro, <code class="mw-highlight mw-highlight-lang-c mw-content-ltr" dir="ltr"><span class="n">NDEBUG</span></code>. If <code class="mw-highlight mw-highlight-lang-c mw-content-ltr" dir="ltr"><span class="n">NDEBUG</span></code> is defined as a macro name, the <code class="mw-highlight mw-highlight-lang-c mw-content-ltr" dir="ltr"><span class="n">assert</span></code> macro is defined as <code class="mw-highlight mw-highlight-lang-c mw-content-ltr" dir="ltr"><span class="cp">#define assert(ignore) ((void)0)</span></code>,<sup id="cite_ref-FOOTNOTEISO/IEC_JTC_1/SC_22/WG141999169_3-1" class="reference"><a href="#cite_note-FOOTNOTEISO/IEC_JTC_1/SC_22/WG141999169-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup> thus resulting in the macro not evaluating the expression. The use of <code class="mw-highlight mw-highlight-lang-c mw-content-ltr" dir="ltr"><span class="n">NDEBUG</span></code> may affect the overall behavior of a program if one or more <code class="mw-highlight mw-highlight-lang-c mw-content-ltr" dir="ltr"><span class="n">assert</span></code> statements contain <a href="Side_effect_(computer_science)" title="Side effect (computer science)">side effects</a>, as these statements are not evaluated.<sup id="cite_ref-FOOTNOTEAmerican_National_Standards_Institute199076_6-0" class="reference"><a href="#cite_note-FOOTNOTEAmerican_National_Standards_Institute199076-6"><span class="cite-bracket">[</span>6<span class="cite-bracket">]</span></a></sup>
</p><p>The <code class="mw-highlight mw-highlight-lang-c mw-content-ltr" dir="ltr"><span class="n">assert</span></code> macro does not include an <a href="Error_message" title="Error message">error message</a>. However the <a href="Comma_operator" title="Comma operator">comma operator</a> can be used to add it to the printed expression, as in <code class="mw-highlight mw-highlight-lang-c mw-content-ltr" dir="ltr"><span class="n">assert</span><span class="p">((</span><span class="s">"Not Orwellian"</span><span class="p">,</span><span class="w"> </span><span class="mi">2</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="mi">2</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="mi">5</span><span class="p">));</span></code>.<sup id="cite_ref-FOOTNOTEGregoire20211058_7-0" class="reference"><a href="#cite_note-FOOTNOTEGregoire20211058-7"><span class="cite-bracket">[</span>7<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading3"><h3 id="static_assert"><span class="monospaced">static_assert</span></h3></div>
<p>The <code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">static_assert</code> keyword, added in <a href="C%2B%2B11" title="C++11">C++11</a>, serves a similar purpose to the <code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">assert</code> macro. Unlike the <code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">assert</code> macro, <code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">static_assert</code> runs at <a href="Compile-time" class="mw-redirect" title="Compile-time">compile-time</a> rather than at runtime.<sup id="cite_ref-FOOTNOTEISO/IEC_JTC_1/SC_22/WG212012134_8-0" class="reference"><a href="#cite_note-FOOTNOTEISO/IEC_JTC_1/SC_22/WG212012134-8"><span class="cite-bracket">[</span>8<span class="cite-bracket">]</span></a></sup> The original implementation used template hacks. The <code class="mw-highlight mw-highlight-lang-cpp mw-content-ltr" dir="ltr"><span class="k">static_assert</span></code> keyword takes in a constant expression that can be converted into a <a href="Boolean_data_type" title="Boolean data type">Boolean</a> and a string literal; if the expression fails, the string literal is returned, otherwise, the assertion has no effect.<sup id="cite_ref-FOOTNOTEISO/IEC_JTC_1/SC_22/WG212012134_8-1" class="reference"><a href="#cite_note-FOOTNOTEISO/IEC_JTC_1/SC_22/WG212012134-8"><span class="cite-bracket">[</span>8<span class="cite-bracket">]</span></a></sup> In <a href="C%2B%2B17" title="C++17">C++17</a>, this assertion failure message was made optional, and the subsequent message is omitted if not specified.<sup id="cite_ref-FOOTNOTESwaminathan201713_9-0" class="reference"><a href="#cite_note-FOOTNOTESwaminathan201713-9"><span class="cite-bracket">[</span>9<span class="cite-bracket">]</span></a></sup>
</p><p>In <a href="C11_(C_standard_revision)" title="C11 (C standard revision)">C11</a>, the functionally equivalent declaration <code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">_Static_assert</code> was added. <code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">&lt;assert.h&gt;</code> defines <code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">static_assert</code> as an alias for <code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">_Static_assert</code> to ensure parity with <a href="C%2B%2B" title="C++">C++</a>.<sup id="cite_ref-FOOTNOTEPrata2013762-763_10-0" class="reference"><a href="#cite_note-FOOTNOTEPrata2013762-763-10"><span class="cite-bracket">[</span>10<span class="cite-bracket">]</span></a></sup> In <a href="C23_(C_standard_revision)" title="C23 (C standard revision)">C23</a>, <code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">_Static_assert</code> was renamed to <code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">static_assert</code> and the string literal argument was made optional.<sup id="cite_ref-FOOTNOTEGustedt20223_11-0" class="reference"><a href="#cite_note-FOOTNOTEGustedt20223-11"><span class="cite-bracket">[</span>11<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-FOOTNOTEBallmanGrammatech20181_12-0" class="reference"><a href="#cite_note-FOOTNOTEBallmanGrammatech20181-12"><span class="cite-bracket">[</span>12<span class="cite-bracket">]</span></a></sup> <a href="Gnulib" title="Gnulib">Gnulib</a> defines <code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">static_assert</code> for platforms that do not use C11 and does not require <code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">&lt;assert.h&gt;</code> to be included.<sup id="cite_ref-13" class="reference"><a href="#cite_note-13"><span class="cite-bracket">[</span>13<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading3"><h3 id="contract_assert"><span class="monospaced">contract_assert</span></h3></div>
<p>The <code class="mw-highlight mw-highlight-lang-text mw-content-ltr" style="" dir="ltr">contract_assert</code> keyword, added in <a href="C%2B%2B26" title="C++26">C++26</a>, is for <a href="Design_by_contract" title="Design by contract">contract</a> assertions and used to verify internal conditions similar to the <code>assert()</code> macro by ensuring that a condition holds during execution.<sup id="cite_ref-14" class="reference"><a href="#cite_note-14"><span class="cite-bracket">[</span>14<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-15" class="reference"><a href="#cite_note-15"><span class="cite-bracket">[</span>15<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-highlight mw-highlight-lang-cpp mw-content-ltr" dir="ltr"><pre><span></span><span class="kt">int</span><span class="w"> </span><span class="nf">f</span><span class="p">(</span><span class="n">vector</span><span class="o">&lt;</span><span class="kt">int</span><span class="o">&gt;&amp;</span><span class="w"> </span><span class="n">v</span><span class="p">)</span>
<span class="w">    </span><span class="n">pre</span><span class="w"> </span><span class="p">(</span><span class="n">v</span><span class="p">.</span><span class="n">size</span><span class="p">()</span><span class="w"> </span><span class="o">&gt;=</span><span class="w"> </span><span class="mi">1</span><span class="w"> </span><span class="o">&amp;&amp;</span><span class="w"> </span><span class="n">v</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="w"> </span><span class="o">&gt;</span><span class="w"> </span><span class="mi">0</span><span class="p">)</span>
<span class="w">    </span><span class="n">post</span><span class="w"> </span><span class="p">(</span><span class="n">r</span><span class="o">:</span><span class="w"> </span><span class="n">r</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="n">v</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="w"> </span><span class="o">&amp;&amp;</span><span class="w"> </span><span class="n">r</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w">    </span><span class="c1">// ...</span>
<span class="w">    </span><span class="n">contract_assert</span><span class="p">(</span><span class="n">v</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="mi">1</span><span class="p">);</span>
<span class="w">    </span><span class="c1">// ...</span>
<span class="w">    </span><span class="k">return</span><span class="w"> </span><span class="n">v</span><span class="p">[</span><span class="mi">0</span><span class="p">];</span>
<span class="p">}</span>
</pre></div>
<div class="mw-heading mw-heading2"><h2 id="Other_languages">Other languages</h2></div>
<p>In <a href="Java_(programming_language)" title="Java (programming language)">Java</a>, <code>assert</code> is a keyword.
</p><p>In <a href="C_Sharp_(programming_language)" title="C Sharp (programming language)">C#</a>, there is no assertion macro or keyword, but instead classes <code>System.Diagnostics.Debug</code> and <code>System.Diagnostics.Trace</code> which provide <code>Assert()</code> methods.
</p><p>In <a href="Rust_(programming_language)" title="Rust (programming language)">Rust</a>, there is an <code>assert!()</code> macro.
</p>
<div class="mw-heading mw-heading2"><h2 id="References">References</h2></div>
<div class="mw-heading mw-heading3"><h3 id="Citations">Citations</h3></div>
<style data-mw-deduplicate="TemplateStyles:r1327269900">
/* start https://en.wikipedia.org/ */


.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}body.skin-vector-2022 .mw-parser-output .reflist-columns-2{column-width:27em}body.skin-vector-2022 .mw-parser-output .reflist-columns-3{column-width:22.5em}.mw-parser-output .references[data-mw-group=upper-alpha]{list-style-type:upper-alpha}.mw-parser-output .references[data-mw-group=upper-roman]{list-style-type:upper-roman}.mw-parser-output .references[data-mw-group=lower-alpha]{list-style-type:lower-alpha}.mw-parser-output .references[data-mw-group=lower-greek]{list-style-type:lower-greek}.mw-parser-output .references[data-mw-group=lower-roman]{list-style-type:lower-roman}.mw-parser-output div.reflist-liststyle-upper-alpha .references{list-style-type:upper-alpha}.mw-parser-output div.reflist-liststyle-upper-roman .references{list-style-type:upper-roman}.mw-parser-output div.reflist-liststyle-lower-alpha .references{list-style-type:lower-alpha}.mw-parser-output div.reflist-liststyle-lower-greek .references{list-style-type:lower-greek}.mw-parser-output div.reflist-liststyle-lower-roman .references{list-style-type:lower-roman}


/* end   https://en.wikipedia.org/ */
</style><div>
<div class="mw-references-wrap mw-references-columns"><ol class="references">
<li id="cite_note-FOOTNOTEBinder2000860-1"><span class="mw-cite-backlink"><b><a href="#cite_ref-FOOTNOTEBinder2000860_1-0">^</a></b></span> <span class="reference-text"><a href="#CITEREFBinder2000">Binder 2000</a>, p.&nbsp;860.</span>
</li>
<li id="cite_note-FOOTNOTEKernighanRitchie1988253-254-2"><span class="mw-cite-backlink"><b><a href="#cite_ref-FOOTNOTEKernighanRitchie1988253-254_2-0">^</a></b></span> <span class="reference-text"><a href="#CITEREFKernighanRitchie1988">Kernighan &amp; Ritchie 1988</a>, p.&nbsp;253-254.</span>
</li>
<li id="cite_note-FOOTNOTEISO/IEC_JTC_1/SC_22/WG141999169-3"><span class="mw-cite-backlink">^ <a href="#cite_ref-FOOTNOTEISO/IEC_JTC_1/SC_22/WG141999169_3-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-FOOTNOTEISO/IEC_JTC_1/SC_22/WG141999169_3-1"><sup><i><b>b</b></i></sup></a></span> <span class="reference-text"><a href="#CITEREFISO/IEC_JTC_1/SC_22/WG141999">ISO/IEC JTC 1/SC 22/WG14 1999</a>, p.&nbsp;169.</span>
</li>
<li id="cite_note-4"><span class="mw-cite-backlink"><b><a href="#cite_ref-4">^</a></b></span> <span class="reference-text"><style data-mw-deduplicate="TemplateStyles:r1333433106">
/* start https://en.wikipedia.org/ */


.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("./_mw_/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("./_mw_/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("./_mw_/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("./_mw_/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#bf3c2c)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#bf3c2c)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}


/* end   https://en.wikipedia.org/ */
</style><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://fog.misty.com/perry/osp/C99/man/assert.html">"Linux Programmer's Manual"</a>. August 25, 2002<span class="reference-accessdate">. Retrieved <span class="nowrap">March 14,</span> 2023</span>.</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=unknown&amp;rft.btitle=Linux+Programmer%27s+Manual&amp;rft.date=2002-08-25&amp;rft_id=https%3A%2F%2Ffog.misty.com%2Fperry%2Fosp%2FC99%2Fman%2Fassert.html&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3AAssert.h" class="Z3988"></span></span>
</li>
<li id="cite_note-5"><span class="mw-cite-backlink"><b><a href="#cite_ref-5">^</a></b></span> <span class="reference-text"><cite id="CITEREFReekie1995" class="citation web cs1">Reekie, John (December 7, 1995). <a rel="nofollow" class="external text" href="https://ptolemy.berkeley.edu/~johnr/tutorials/assertions.html">"How to use assertions in C"</a>. <a href="University_of_California%2C_Berkeley" title="University of California, Berkeley">University of California, Berkeley</a><span class="reference-accessdate">. Retrieved <span class="nowrap">March 14,</span> 2023</span>.</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=unknown&amp;rft.btitle=How+to+use+assertions+in+C&amp;rft.pub=University+of+California%2C+Berkeley&amp;rft.date=1995-12-07&amp;rft.aulast=Reekie&amp;rft.aufirst=John&amp;rft_id=https%3A%2F%2Fptolemy.berkeley.edu%2F~johnr%2Ftutorials%2Fassertions.html&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3AAssert.h" class="Z3988"></span></span>
</li>
<li id="cite_note-FOOTNOTEAmerican_National_Standards_Institute199076-6"><span class="mw-cite-backlink"><b><a href="#cite_ref-FOOTNOTEAmerican_National_Standards_Institute199076_6-0">^</a></b></span> <span class="reference-text"><a href="#CITEREFAmerican_National_Standards_Institute1990">American National Standards Institute 1990</a>, p.&nbsp;76.</span>
</li>
<li id="cite_note-FOOTNOTEGregoire20211058-7"><span class="mw-cite-backlink"><b><a href="#cite_ref-FOOTNOTEGregoire20211058_7-0">^</a></b></span> <span class="reference-text"><a href="#CITEREFGregoire2021">Gregoire 2021</a>, p.&nbsp;1058.</span>
</li>
<li id="cite_note-FOOTNOTEISO/IEC_JTC_1/SC_22/WG212012134-8"><span class="mw-cite-backlink">^ <a href="#cite_ref-FOOTNOTEISO/IEC_JTC_1/SC_22/WG212012134_8-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-FOOTNOTEISO/IEC_JTC_1/SC_22/WG212012134_8-1"><sup><i><b>b</b></i></sup></a></span> <span class="reference-text"><a href="#CITEREFISO/IEC_JTC_1/SC_22/WG212012">ISO/IEC JTC 1/SC 22/WG21 2012</a>, p.&nbsp;134.</span>
</li>
<li id="cite_note-FOOTNOTESwaminathan201713-9"><span class="mw-cite-backlink"><b><a href="#cite_ref-FOOTNOTESwaminathan201713_9-0">^</a></b></span> <span class="reference-text"><a href="#CITEREFSwaminathan2017">Swaminathan 2017</a>, p.&nbsp;13.</span>
</li>
<li id="cite_note-FOOTNOTEPrata2013762-763-10"><span class="mw-cite-backlink"><b><a href="#cite_ref-FOOTNOTEPrata2013762-763_10-0">^</a></b></span> <span class="reference-text"><a href="#CITEREFPrata2013">Prata 2013</a>, p.&nbsp;762-763.</span>
</li>
<li id="cite_note-FOOTNOTEGustedt20223-11"><span class="mw-cite-backlink"><b><a href="#cite_ref-FOOTNOTEGustedt20223_11-0">^</a></b></span> <span class="reference-text"><a href="#CITEREFGustedt2022">Gustedt 2022</a>, p.&nbsp;3.</span>
</li>
<li id="cite_note-FOOTNOTEBallmanGrammatech20181-12"><span class="mw-cite-backlink"><b><a href="#cite_ref-FOOTNOTEBallmanGrammatech20181_12-0">^</a></b></span> <span class="reference-text"><a href="#CITEREFBallmanGrammatech2018">Ballman &amp; Grammatech 2018</a>, p.&nbsp;1.</span>
</li>
<li id="cite_note-13"><span class="mw-cite-backlink"><b><a href="#cite_ref-13">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://www.gnu.org/software//gnulib/manual/html_node/static_005fassert.html">"GNU Gnulib"</a>. <a href="Free_Software_Foundation" title="Free Software Foundation">Free Software Foundation</a>. February 6, 2023<span class="reference-accessdate">. Retrieved <span class="nowrap">March 14,</span> 2023</span>.</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=unknown&amp;rft.btitle=GNU+Gnulib&amp;rft.pub=Free+Software+Foundation&amp;rft.date=2023-02-06&amp;rft_id=https%3A%2F%2Fwww.gnu.org%2Fsoftware%2F%2Fgnulib%2Fmanual%2Fhtml_node%2Fstatic_005fassert.html&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3AAssert.h" class="Z3988"></span></span>
</li>
<li id="cite_note-14"><span class="mw-cite-backlink"><b><a href="#cite_ref-14">^</a></b></span> <span class="reference-text"><cite id="CITEREFJoshua_Berne,_Timur_Doumler,_Andrzej_Krzemieński2025" class="citation web cs1">Joshua Berne, Timur Doumler, Andrzej Krzemieński (13 February 2025). <a rel="nofollow" class="external text" href="https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p2900r14.pdf">"Contracts for C++"</a> <span class="cs1-format">(PDF)</span>. <i>open-std.org</i>. WG 22.</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.genre=unknown&amp;rft.jtitle=open-std.org&amp;rft.atitle=Contracts+for+C%2B%2B&amp;rft.date=2025-02-13&amp;rft.au=Joshua+Berne%2C+Timur+Doumler%2C+Andrzej+Krzemie%C5%84ski&amp;rft_id=https%3A%2F%2Fwww.open-std.org%2Fjtc1%2Fsc22%2Fwg21%2Fdocs%2Fpapers%2F2025%2Fp2900r14.pdf&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3AAssert.h" class="Z3988"></span><span class="cs1-maint citation-comment"><code class="cs1-code">{{cite web}}</code>:  CS1 maint: multiple names: authors list (link)</span></span>
</li>
<li id="cite_note-15"><span class="mw-cite-backlink"><b><a href="#cite_ref-15">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://en.cppreference.com/w/cpp/language/contracts.html">"Contract assertions (since C++26)"</a>. <i>cppreference.com</i>. cppreference<span class="reference-accessdate">. Retrieved <span class="nowrap">9 November</span> 2025</span>.</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.genre=unknown&amp;rft.jtitle=cppreference.com&amp;rft.atitle=Contract+assertions+%28since+C%2B%2B26%29&amp;rft_id=https%3A%2F%2Fen.cppreference.com%2Fw%2Fcpp%2Flanguage%2Fcontracts.html&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3AAssert.h" class="Z3988"></span></span>
</li>
</ol></div></div>
<div class="mw-heading mw-heading3"><h3 id="Bibliography">Bibliography</h3></div>
<ul><li><cite id="CITEREFAmerican_National_Standards_Institute1990" class="citation book cs1"><a href="American_National_Standards_Institute" title="American National Standards Institute">American National Standards Institute</a> (1990). <i>Rationale for the ANSI C Programming Language</i>. Summit: Silicon Press. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>9780929306070</bdi>.</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=book&amp;rft.btitle=Rationale+for+the+ANSI+C+Programming+Language&amp;rft.place=Summit&amp;rft.pub=Silicon+Press&amp;rft.date=1990&amp;rft.isbn=9780929306070&amp;rft.au=American+National+Standards+Institute&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3AAssert.h" class="Z3988"></span></li>
<li><cite id="CITEREFBallmanGrammatech2018" class="citation report cs1">Ballman, Aaron; Grammatech (July 6, 2018). Harmonizing static_assert with C++ (Report).</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=report&amp;rft.btitle=Harmonizing+static_assert+with+C%2B%2B&amp;rft.date=2018-07-06&amp;rft.aulast=Ballman&amp;rft.aufirst=Aaron&amp;rft.au=Grammatech&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3AAssert.h" class="Z3988"></span></li>
<li><cite id="CITEREFBinder2000" class="citation book cs1">Binder, Robert (2000). <i>Testing Object-oriented Systems: Models, Patterns, and Tools</i> (2nd&nbsp;ed.). Boston: <a href="Addison-Wesley" title="Addison-Wesley">Addison-Wesley</a>. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>9780201809381</bdi>.</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=book&amp;rft.btitle=Testing+Object-oriented+Systems%3A+Models%2C+Patterns%2C+and+Tools&amp;rft.place=Boston&amp;rft.edition=2nd&amp;rft.pub=Addison-Wesley&amp;rft.date=2000&amp;rft.isbn=9780201809381&amp;rft.aulast=Binder&amp;rft.aufirst=Robert&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3AAssert.h" class="Z3988"></span></li>
<li><cite id="CITEREFGregoire2021" class="citation book cs1">Gregoire, Marc (2021). <i>Professional C++</i> (5th&nbsp;ed.). Hoboken: <a href="Wiley_(publisher)" title="Wiley (publisher)">Wiley</a>. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>9781119695455</bdi>.</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=book&amp;rft.btitle=Professional+C%2B%2B&amp;rft.place=Hoboken&amp;rft.edition=5th&amp;rft.pub=Wiley&amp;rft.date=2021&amp;rft.isbn=9781119695455&amp;rft.aulast=Gregoire&amp;rft.aufirst=Marc&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3AAssert.h" class="Z3988"></span></li>
<li><cite id="CITEREFGustedt2022" class="citation report cs1">Gustedt, Jens (February 15, 2022). Revise spelling of keywords (Report).</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=report&amp;rft.btitle=Revise+spelling+of+keywords&amp;rft.date=2022-02-15&amp;rft.aulast=Gustedt&amp;rft.aufirst=Jens&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3AAssert.h" class="Z3988"></span></li>
<li><cite id="CITEREFKernighanRitchie1988" class="citation book cs1"><a href="Brian_Kernighan" title="Brian Kernighan">Kernighan, Brian</a>; <a href="Dennis_Ritchie" title="Dennis Ritchie">Ritchie, Dennis</a> (1988). <i>The C Programming Language</i> (2nd&nbsp;ed.). Hoboken: Prentice Hall. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>9780131103627</bdi>.</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=book&amp;rft.btitle=The+C+Programming+Language&amp;rft.place=Hoboken&amp;rft.edition=2nd&amp;rft.pub=Prentice+Hall&amp;rft.date=1988&amp;rft.isbn=9780131103627&amp;rft.aulast=Kernighan&amp;rft.aufirst=Brian&amp;rft.au=Ritchie%2C+Dennis&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3AAssert.h" class="Z3988"></span></li>
<li><cite id="CITEREFLischner2009" class="citation book cs1">Lischner, Ray (2009). <i>C++ In a Nutshell: A Desktop Quick Reference</i> (2nd&nbsp;ed.). Sebastopol: <a href="O'Reilly_Media" title="O'Reilly Media">O'Reilly Media</a>. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>9781449378837</bdi>.</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=book&amp;rft.btitle=C%2B%2B+In+a+Nutshell%3A+A+Desktop+Quick+Reference&amp;rft.place=Sebastopol&amp;rft.edition=2nd&amp;rft.pub=O%27Reilly+Media&amp;rft.date=2009&amp;rft.isbn=9781449378837&amp;rft.aulast=Lischner&amp;rft.aufirst=Ray&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3AAssert.h" class="Z3988"></span></li>
<li><cite id="CITEREFISO/IEC_JTC_1/SC_22/WG141999" class="citation report cs1"><a href="ISO/IEC_JTC_1/SC_22" title="ISO/IEC JTC 1/SC 22">ISO/IEC JTC 1/SC 22/WG14</a> (December 1999). ISO/IEC 9899:1999 (Report).</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=report&amp;rft.btitle=ISO%2FIEC+9899%3A1999&amp;rft.date=1999-12&amp;rft.au=ISO%2FIEC+JTC+1%2FSC+22%2FWG14&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3AAssert.h" class="Z3988"></span><span class="cs1-maint citation-comment"><code class="cs1-code">{{cite report}}</code>:  CS1 maint: numeric names: authors list (link)</span></li>
<li><cite id="CITEREFISO/IEC_JTC_1/SC_22/WG212012" class="citation report cs1"><a href="ISO/IEC_JTC_1/SC_22" title="ISO/IEC JTC 1/SC 22">ISO/IEC JTC 1/SC 22/WG21</a> (January 2012). ISO/IEC 14882:2011 (Report).</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=report&amp;rft.btitle=ISO%2FIEC+14882%3A2011&amp;rft.date=2012-01&amp;rft.au=ISO%2FIEC+JTC+1%2FSC+22%2FWG21&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3AAssert.h" class="Z3988"></span><span class="cs1-maint citation-comment"><code class="cs1-code">{{cite report}}</code>:  CS1 maint: numeric names: authors list (link)</span></li>
<li><cite id="CITEREFPrata2013" class="citation book cs1">Prata, Stephen (2013). <i>C Primer Plus</i> (6th&nbsp;ed.). London: <a href="Pearson_Education" title="Pearson Education">Pearson Education</a>. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>9780133432381</bdi>.</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=book&amp;rft.btitle=C+Primer+Plus&amp;rft.place=London&amp;rft.edition=6th&amp;rft.pub=Pearson+Education&amp;rft.date=2013&amp;rft.isbn=9780133432381&amp;rft.aulast=Prata&amp;rft.aufirst=Stephen&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3AAssert.h" class="Z3988"></span></li>
<li><cite id="CITEREFSwaminathan2017" class="citation book cs1">Swaminathan, Jeganathan (2017). <i>Mastering C++ Programming</i>. Birmingham: <a href="Packt" title="Packt">Packt</a>. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>9781786461629</bdi>.</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=book&amp;rft.btitle=Mastering+C%2B%2B+Programming&amp;rft.place=Birmingham&amp;rft.pub=Packt&amp;rft.date=2017&amp;rft.isbn=9781786461629&amp;rft.aulast=Swaminathan&amp;rft.aufirst=Jeganathan&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3AAssert.h" class="Z3988"></span></li></ul></div><!--htdig_noindex--><div><div class="zim-footer">
    This article is issued from <a class="external text" title="Last edited on 2025-11-22" href="https://en.wikipedia.org/wiki/?title=Assert.h&amp;oldid=1323484838">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
            </div>
          </main>
        </div>
      </div>
    </div>
     <script src="./_webp_/webpHandler.js"></script>
  

</body></html>