C 2017 TP1 Cheat Sheet

3,840 views 1,445 downloads 12 Oct 2017 History
3.7 avg · 0 ratings

Déclar­ations de variables

typename variab­lename;
typename variab­lename = expres­sion;

Conditions

if (expre­ssi­onBool) { ... }
if (expre­ssi­onBool) { ... }
else { ... }
if (expre­ssi­onBool) { ... }
else if (expre­ssi­onBool) { ... }
...
else { ... }

Boucles

while (exprBool) { ... }
do { ... } while (exprB­ool);
for(init ; exprBool ; incr) { ... }

For / While

for (a ; b ; c) { d; }

// equivalent to

a; 
while(b) {
   d;
   c;
}

Afficher du texte

printf­("he­llo­");
hello
printf­("x = %d", 5);
x = 5

Comments

No comments yet.

Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.