-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
2 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<!doctype html><html lang="en"><head><meta charset="UTF-8"><meta name="darkreader-lock"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Violette • 3.1 Main</title><link rel="shortcut icon" href="/assets/images/pecklo.webp" type="image/x-icon"><link rel="stylesheet" href="/assets/css/main.min.css"><script type="module" src="/assets/js/main.js" defer="defer"></script></head><body><div id="sidebar"><nav><section id="about"><img width="296" height="296" src="/assets/images/peklo-transparent.png" alt=""> <a id="" href="/">Violette</a></section><section id="links"><a href="/awesome/">Awesome</a> • <a href="/blogs/">Blogs</a> • <a href="/">Home</a> • <a href="/projects/">Projects</a> • <a target="_blank" href="https://github.com/imsumire/">Github</a> • <a target="_blank" href="https://www.pinterest.fr/Violettttte/">Pinterest</a></section></nav><footer><p>Made with ❤ by <a target="_blank" href="https://github.com/ImSumire">@imsumire</a></p><p>Using <a target="_blank" href="https://www.11ty.dev/">11ty</a>, <a target="_blank" href="https://swup.js.org/">Swup</a>, <a target="_blank" href="https://sass-lang.com/">Sass</a> and <a target="_blank" href="https://www.typescriptlang.org/">TypeScript</a></p></footer></div><main class="transition-main"><h1>3.1 Main</h1><p>Tout programme C commence par la fonction <code>main</code> ("principal" en anglais). C'est la fonction qui est appelée lorsque le programme est exécuté.<br></p><p>En C, on ne code presque jamais en dehors de fonctions. En Ocaml ou Python, il n'y a pas besoin de <code>main</code> car tout le code qui est écrit s'exécute, mais ici, chaque expression est écrite dans le <code>main</code> ou une autre fonction.<br></p><p>Voici un exemple de code minimal :</p><pre class="language-c"><code class="language-c"><span class="token keyword">int</span> <span class="token function">main</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span> | ||
<span class="token keyword">return</span> <span class="token number">0</span><span class="token punctuation">;</span> | ||
<span class="token punctuation">}</span></code></pre><blockquote><p><em>Ce code ne fait rien, à part retourner 0</em></p></blockquote><section class="accordion"><input type="checkbox" checked="checked"><h4>Note<i></i></h4><article><p>En réalité nous pouvons faire moins, mais il est fortement conseillé d'utiliser <code>int</code> en valeur de retour et explicitement retourner la valeur.</p><p>Dans ce cours nous allons apprendre à coder avec des conventions - dont le retour explicite et la compatibilité pour tous les systèmes en font partis - afin de produire du code <strong>lisible</strong>, <strong>expressif</strong> et de <strong>qualité</strong>.</p></article></section><a href="/blog/c/syntax"><button class="prevlink">3.0 Syntax</button></a> <a href="/blog/c/comments"><button class="nextlink">3.2 Comments</button></a></main></body></html> | ||
<span class="token punctuation">}</span></code></pre><blockquote><p><em>Ce code ne fait rien, à part retourner 0</em></p></blockquote><section class="accordion"><input type="checkbox" checked="checked"><h4>Note<i></i></h4><article><p>En réalité nous pouvons faire moins, mais il est fortement conseillé d'utiliser <code>int</code> en valeur de retour et explicitement retourner la valeur.</p><p>Dans ce cours nous allons apprendre à coder avec des conventions - dont le retour explicite et la compatibilité pour tous les systèmes en font partie - afin de produire du code <strong>lisible</strong>, <strong>expressif</strong> et de <strong>qualité</strong>.</p></article></section><a href="/blog/c/syntax"><button class="prevlink">3.0 Syntax</button></a> <a href="/blog/c/comments"><button class="nextlink">3.2 Comments</button></a></main></body></html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters