C-Kurs 2009/Vortrag01
Inhaltsverzeichnis
Einführung
Vortragende: Sebastian D. <dyroff cs.tu-berlin.de>
Themen
- Organisatorisches
- Konzept von C
- Syntax
- Operatoren
- ! ~
- + - * / % ^ | & || && . [->]
- ++ -- (++x vs x++)
- << >>
- += -= *= /= %= |= &= != ~= ^=
- <<= >>=
- Hirarchie
- ++x*3 ?
- TODO Weitere Beispiele! (andere Resultate, andere Parameter)
// Von Sebastian P. #include <stdio.h> int main(void) { const int APPLE = 1; const int PEAR = 2; const int MILK = 4; const int FRUIT_MASK = APPLE | PEAR; const int meal = MILK | PEAR; /* Test: Does the meal contain fruits? */ printf("%d\n", meal & FRUIT_MASK != 0); /* 0, precendence fail */ printf("%d\n", (meal & FRUIT_MASK) != 0); /* 1, as expected */ return 0; }
- x ? x : x
- Hello World
- Compilereinführung