Changes

Langage C

2,296 bytes added, 23:08, 15 April 2023
/* liens : documentation Site Internet */
| 1
|}
 
<u>Exemple</u>
int A = 1; // Non Null
int B = 2; // Non Null
int C = 0; // Null
int V; // result
V = A && B; // V vaut 1, car les deux champs sont a '1' logiquement
V = A && C; // V vaut 0, car l'un des deux champs est à '0'
===== Operateur logique "OR(E) - OU(F) => ||" =====
| 1
|}
 
===== Operateur logique "NO(E) - NON(F) => !" =====
''In french'': inverse le résultat d'une expression -> si celle-ci est vraie ('1'), elle devient fausse('0')
 
''In English'': invert the expression result -> if this one is true ('1'), it becomes false ('0')
 
{| class="wikitable" style="text-align:center;"
|+ Table de verité pour Operateur NON (!)
|-
! scope="col" | Expression 1
! scope="col" | !E1 (valeur de retour)
|-
| 0
| 1
|-
| 1
| 0
|}
 
===== Operateur bit à bit =====
 
& (ET / AND) -> exemple : 0101 & 0110 = 0100
| (OU / OR) -> exemple : 0010 & 0110 = 0110
^ (OU EXCLUSIF / XOR) -> exemple : 0100 ^ 1101 = 1001
~ (inverseur) -> exemple : ~0100 = 1011
 
===== Operateur de Décalage =====
 
décalage a droite de x bits >>
(a = 8) >> (b = 2) = a >> b = 8 >> 2 (la valeur de 8 décaler de 2 bit à droite) = 1000 >> 10 = 0010
décalage à gauche de x bit <<
(a = 8) >> (b = 3) = a << b = 8 << 3 (la valeur de 8 décaler de 3 bit à gauche) = 1000 << 11 = 1000000
==== Trick ====
'''Warning''': don't mistake this : '=' & '==' => the first symbol correponds at the allocation / the second symbol corresponds at the test between two variables. Same thing concerning the bit to bit operator and the logique operator  <u>Exemple</u> (a = 8) & (b = 1) = a & b = 1000 & 0001 = 0000 (a = 8) && (b = 1) = a && b = 1000 && 0001 = 1
For an expression or an operator which retunrs a value no null (different of zero) is considered like TRUE('1'), but if it is opposite, the return value is FALSE('0')
 
Concenring the gap operator : if there is a gap side right, it is equivalent to cut a value at 2^ the gap value
<u>exemple</u>
(a = 8) >> (b = 2) = a >> b = 8 >> 2 = <math> \frac{8}{(2^2)}</math>
 
if there is a gap side left, it is equivalent to multiply a value at 2 ^ the gap value
<u>exemple</u>
(a = 8) << (b = 2) = a << b = 8 << 2 = <math> {8} \cdot {(2^2)}</math>
=== chapter 7 (résumé) ===
== Liens utiles ==
 
=== lien : vidéo (youtube) ===
* [1] [https://www.youtube.com/watch?v=_fZF5SOAS70 configuration debugger pour code blocks]
 
=== liens : documentation PDF ===
* [5] [http://www.apprendre-informatique.com/tutorial/programmation/langage-c/mots-cles-du-c/ mot clé en C]
* [6] [http://www.table-ascii.com/ table ASCII]
* [6a] [https://www.asciitable.com/ table ASCII]
* [7] [http://pubs.opengroup.org/onlinepubs/009695399/functions/fprintf.html explication globale sur les functions f/printf...]
* [8] [http://melem.developpez.com/tutoriels/langage-c/initiation-langage-c/?page=es infos sur les entrées - Sorties]
* [9] [http://pwet.fr/man/linux/fonctions_bibliotheques/stdio listing des fonctions de la librairie stdio.h]
* [10] [http://www.linux-france.org/prj/embedded/sdcc/sdcc_course.formatted_io.html les différents indicateurs de format pour la function printf]
* [11] [http://www.cplusplus.com/reference/cstdio/printf/ indicateurs/patramètres pour la fonction de printf]
* [12] [https://msdn.microsoft.com/fr-fr/library/cc953fe1.aspx type fondamentaux en C++ sur VS2015]
* [13] [https://fr.wikibooks.org/wiki/Programmation_C/Types_de_base Type de base]
== Bibliographie ==
952
edits