HTML Tutorials |
|
XML Tutorials |
|
Browser Scripting |
|
Server Scripting |
|
.NET (dotnet) |
|
Multimedia |
|
Web Building |
|
Java Tutorials |
|
Programming Langauges |
|
Soft Skills |
|
Database Tutorials |
|
Operating System |
|
Software Testing |
|
SAP Module |
|
Networking Programming |
|
Microsoft Office |
|
Accounting |
|
|
�berblick �ber die C Operatoren
|
Die c Operatoren fallen in die folgenden Kategorien:
- Postfix Operatoren, die nur einer einzelnen Rechengr��e folgen.
- Einstoffvorzeichenoperatoren, die mit einer einzelnen Rechengr��e vorangehen.
- Bin�re Operatoren, die zwei Rechengr��en nehmen und eine Vielzahl der logischen und arithmetischen Betriebe durchf�hren.
- Der bedingte Operator (ein dreifacher Operator), das drei Rechengr��en nimmt und entweder den zweiten oder dritten Ausdruck auswertet, abh�ngig von der Auswertung nur des ersten Ausdruckes.
- Zuweisungsoperatoren, die nur einen Wert einer Variable zuweisen.
- Der Kommaoperator, der Garantien von links nach rechts verlaufende Auswertung der Komma-getrennten Ausdr�cke gibt.
|
Um kompliziertere Ausdr�cke zu verursachen, k�nnen Variablen und Konstanten in Verbindung mit C Operatoren verwendet werden. Die folgenden Tabellen beschreibt die unterschiedlichen Operatoren, die in c vorhanden sind
|
Operator |
Example |
Description/Meaning |
() |
f() |
Function call |
[] |
a[10] |
Array reference |
-> |
Structure and union member selection |
|
. |
s.a |
Structure and union member selection |
+ [unary] |
+a |
Value of a |
- [unary] |
-a |
Negative of a |
* [unary] |
*a |
Reference to object at address a |
& [unary] |
&a |
Address of a |
~ |
~a |
One's complement of a |
++ [prefix] |
++a |
The value of a after increment |
++ [postfix] |
a++ |
The value of a before increment |
- - [prefix] |
-a |
The value of a after decrement |
- - [postfix] |
a- |
The value of a before decrement |
sizeof |
sizeof (t1) |
Size in bytes of object with type t1 |
sizeof |
sizeof e |
Size in bytes of object having the type of expression e |
+ [binary]
- [binary]
* [binary]
/ % |
a + b
a - b
a * b
a / b
a % b |
a plus b
a minus b
a times b
a divided by b
Remainder of a/b |
>>
<< |
a >> b
a << b |
a, right-shifted b bits
a, left-shifted b bits |
<
>
<=
>=
==
!= |
a < b
a > b
a <= b
a >= b
a == b
a != b |
1 if a < b; 0 otherwise
1 if a > b; 0 otherwise
1 if a <= b; 0 otherwise
1 if a >= b; 0 otherwise
1 if a equal to b; 0 otherwise
1 if a not equal to b; 0 otherwise |
& [binary]
|
^ |
a & b
a | b
a ^ b |
Bitwise AND of a and b
Bitwise OR of a and b
Bitwise XOR (exclusive OR) of a and b |
&&
||
! |
a && b
a || b
!a |
Logical AND of a and b (yields 0 or 1)
Logical OR of a and b (yields 0 or 1)
Logical NOT of a (yields 0 or 1) |
?: |
a ? e1 : e2 |
Expression e1 if a is nonzero;
Expression e2 if a is zero |
=
+=
-=
*=
/=
%=
>>=
<<=
&=
|=
^=
, |
a = b
a += b
a -= b
a *= b
a /= b
a %= b
a >>= b
a <<= b
a &= b
a |= b
a ^= b
e1,e2 |
a, after b is assigned to it
a plus b (assigned to a)
a minus b (assigned to a)
a times b (assigned to a)
a divided by b (assigned to a)
Remainder of a/b (assigned to a)
a, right-shifted b bits (assigned to a)
a, left-shifted b bits (assigned to a)
a AND b (assigned to a)
a OR b (assigned to a)
a XOR b (assigned to a)
e2 (e1 evaluated first) |
|
Vorausgehen der C Operatoren
|
Category |
Operator |
Associativity |
Postfix |
() [] -> . ++ - - |
Left to right |
Unary |
+ - ! ~ ++ - - (type) * & sizeof |
Right to left |
Multiplicative |
* / % |
Left to right |
Additive |
+ - |
Left to right |
Shift |
<< >> |
Left to right |
Relational |
< <= > >= |
Left to right |
Equality |
== != |
Left to right |
Bitwise AND |
& |
Left to right |
Bitwise XOR |
^ |
Left to right |
Bitwise OR |
| |
Left to right |
Logical AND |
&& |
Left to right |
Logical OR |
|| |
Left to right |
Conditional |
?: |
Right to left |
Assignment |
= += -= *= /= %= >>= <<= &= ^= |= |
Right to left |
Comma |
, |
Left to right |
|
Schl�sselw�rter:
c Operatoren, c programmierenoperatoren, c bitweise Operatoren, c Spitze Operatoren, C-Sprache Operatoren, c bin�re Operatoren, c Operator, Operator der c++ Operatoren 'in c, c Operatorenrangfolge, Operatoren in c, Operatoren c, bitweise Operatoren in c, c# Operatoren
|
|
HTML Quizes |
|
XML Quizes |
|
Browser Scripting Quizes |
|
Server Scripting Quizes |
|
.NET (dotnet) Quizes |
|
Multimedia Quizes |
|
Web Building Quizes |
|
Java Quizes |
|
Programming Langauges Quizes |
|
Soft Skills Quizes |
|
Database Quizes |
|
Operating System Quizes |
|
Software Testing Quizes |
|
SAP Module Quizes |
|
Networking Programming Quizes |
|
Microsoft Office Quizes |
|
Accounting Quizes |
|
|