Operatoren
betrifft: Mathematik,
betrifft: C-Programmierung
Operator | Operator_(mathematics) | |
Einstellige Verknüpfung | Unary operation | 1 Operand |
Zweistellige Verknüpfung | Binary_operation | 2 Operanden |
Die Argumente, auf die man einen Operator anwendet, heißen Operanden.
Operatoren haben eine Priorität:
Liste_der_Operatoren_nach_Priorität Populäres Beispiel: Punkt vor Strich
Beispiele:
hier leicht zu testen:
https://www.onlinegdb.com/online_c_compiler
a = 4 + 5 | Binary Operator with Constant & Constant | _J15X86Qu |
a = b + c | Binary Operator with Variable & Variable | R_2pn4hMp |
a = 4 + 5 * 2 | Punkt vor Strich | IK1k10ebE |
a = (4 + 5) * 2 | Klammern | LVBn_m8qA |
a++ | Unary Inkrement Link | 9MyNxQeTr |
a += 2 | Kombinierte Zuweisungen Link | -4nHgpkxH |
a == b | Gleichheit | KURn4fl_M |
a && b | Boolsches und in C | b_kcGGx2a |
klappt nicht, "and" ist nicht definiert in C | 0D7_vh5dL | |
a and b | Boolsches Und (nur C++) | 1bcsNiQ_5 |
https://www.xplore-dna.net/course/view.php?id=15