a
This commit is contained in:
@@ -23,6 +23,9 @@
|
|||||||
<li><a href="#control_flow-ternary">Ternary Operator</a></li>
|
<li><a href="#control_flow-ternary">Ternary Operator</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<li><a href="#other">Other Topics</a></li>
|
<li><a href="#other">Other Topics</a></li>
|
||||||
|
<ul>
|
||||||
|
<li><a href="#other_string-manipulation">String Manipulation</a></li>
|
||||||
|
</ul>
|
||||||
</ul>
|
</ul>
|
||||||
<hr>
|
<hr>
|
||||||
<h2 id="basics">Basics</h2>
|
<h2 id="basics">Basics</h2>
|
||||||
@@ -335,7 +338,16 @@
|
|||||||
<code class="cblock"><pre>x = (a > b) ? 1 : 0;</code></pre>
|
<code class="cblock"><pre>x = (a > b) ? 1 : 0;</code></pre>
|
||||||
This means that if a is greater than b, assign x with 1. If a is not greater than b, assign x with 0. The ternary operator however needs the values in the if and else part to be of the same type. If they are not, the program will fail to compile.
|
This means that if a is greater than b, assign x with 1. If a is not greater than b, assign x with 0. The ternary operator however needs the values in the if and else part to be of the same type. If they are not, the program will fail to compile.
|
||||||
</p>
|
</p>
|
||||||
|
<h2> id="functions"></h2>
|
||||||
|
<p>
|
||||||
|
A function is a wrapper to easily reuse code and improve readability of your program. The function signature contains the return type, the identifier of the function, and the parameters that the function requires. The function contains statements within the curly braces. Finally, the function returns a value which has a type indicated in the function signature.
|
||||||
|
<code class="cblock"><pre>type name (parameters) {...}</pre></code>
|
||||||
|
</p>
|
||||||
<h2 id="other">Other Topics</h2>
|
<h2 id="other">Other Topics</h2>
|
||||||
|
<h3 id="other_string-manipulation">String Manipulation</h3>
|
||||||
|
<p>
|
||||||
|
...
|
||||||
|
</p>
|
||||||
</main>
|
</main>
|
||||||
<?php include '.././snippet/footer.php'?>
|
<?php include '.././snippet/footer.php'?>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
Reference in New Issue
Block a user