summaryrefslogtreecommitdiff
path: root/devdocs/c/language%2Fbasic_concepts.html
blob: f5f9fa6ab81bce6072a85a9edc495aec655106b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
    <h1 id="firstHeading" class="firstHeading">Basic concepts</h1>            <p>This section provides definitions for the specific terminology and the concepts used when describing the C programming language.</p>
<p>A C program is a sequence of text files (typically header and source files) that contain <a href="declarations" title="c/language/declarations">declarations</a>. They undergo <a href="translation_phases" title="c/language/translation phases">translation</a> to become an executable program, which is executed when the OS calls its <a href="main_function" title="c/language/main function">main function</a> (unless it is itself the OS or another <i>freestanding</i> program, in which case the entry point is implementation-defined).</p>
<p>Certain words in a C program have special meaning, they are <a href="../keyword" title="c/keyword">keywords</a>. Others can be used as <a href="identifier" title="c/language/identifier">identifiers</a>, which may be used to identify <a href="object" title="c/language/object">objects</a>, <a href="functions" title="c/language/functions">functions</a>, <a href="struct" title="c/language/struct">struct</a>, <a href="union" title="c/language/union">union</a>, or <a href="enum" title="c/language/enum">enumeration</a> tags, their members, <a href="typedef" title="c/language/typedef">typedef</a> names, <a href="statements#Labels" title="c/language/statements">labels</a>, or <a href="../preprocessor/replace" title="c/preprocessor/replace">macros</a>.</p>
<p>Each identifier (other than macro) is only valid within a part of the program called its <a href="scope" title="c/language/scope">scope</a> and belongs to one of four kinds of <a href="name_space" title="c/language/name space">name spaces</a>. Some identifiers have <a href="storage_duration" title="c/language/storage duration">linkage</a> which makes them refer to the same entities when they appear in different scopes or translation units.</p>
<p>Definitions of functions include sequences of <a href="statements" title="c/language/statements">statements</a> and <a href="declarations" title="c/language/declarations">declarations</a>, some of which include <a href="expressions" title="c/language/expressions">expressions</a>, which specify the computations to be performed by the program.</p>
<p><a href="declarations" title="c/language/declarations">Declarations</a> and <a href="expressions" title="c/language/expressions">expressions</a> create, destroy, access, and manipulate <a href="object" title="c/language/object">objects</a>. Each <a href="object" title="c/language/object">object</a>, <a href="functions" title="c/language/functions">function</a>, and <a href="expressions" title="c/language/expressions">expression</a> in C is associated with a <a href="type" title="c/language/type">type</a>.</p>
<h3 id="See_also"> See also</h3> <table class="t-dsc-begin"> <tr class="t-dsc"> <td colspan="2"> <span><a href="https://en.cppreference.com/w/cpp/language/basic_concepts" title="cpp/language/basic concepts">C++ documentation</a></span> for <span class=""><span>Basic concepts</span></span> </td>
</tr> </table>           <div class="_attribution">
  <p class="_attribution-p">
    &copy; cppreference.com<br>Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.<br>
    <a href="https://en.cppreference.com/w/c/language/basic_concepts" class="_attribution-link">https://en.cppreference.com/w/c/language/basic_concepts</a>
  </p>
</div>