Operator-operator yang disediakan C++ berupa keyword atau karakter khusus. Operator-operator ini cukup penting untuk diketahui karena merupakan salah satu dasar bahasa C++.
1. Assignation (=).
Operator assignation digunakan untuk memberikan nilai ke suatu variable
2. Arithmetic operators ( +, -, *, /, % )
+ addition
- subtraction
* multiplication
/ division
% module
3. Compound assignation operators
(+=, -=, *=, /=, %=, >>=, <<=, &=, ^=, |=)
4. Increase (++) and decrease (--).
5. Relational operators ( ==, !=, >, <, >=, <= )
== Equal
!= Different
> Greater than
< Less than
>= Greater or equal than
<= Less or equal than
6. Logic operators ( !, &&, || ).
7. Conditional operator ( ? ).
8. Bitwise Operators ( &, |, ^, ~, <<, >> ).
op asm Description
& AND Logical AND
| OR Logical OR
^ XOR Logical exclusive OR
~ NOT Complement to one (bit inversion)
<< SHL Shift Left
>> SHR Shift Right
9. Explicit type casting operators
sumber :http://rani_push.staff.gunadarma.ac.id/Downloads/files/4756/bahasa+C%2B%2B.doc
My Fish
Sabtu, 21 Mei 2011
Langganan:
Posting Komentar (Atom)
0 komentar:
Posting Komentar