Appendices – Object-Oriented Programming with ANSI and Turbo C++

Appendices

APPENDIX A

ANSI and Turbo C++ Keywords

Additional Keywords for Turbo C++

APPENDIX B

Data Types in C++

Data Type Size in Bytes Range
char 1 -128 to 127
unsigned char 1 0 to 255
signed char 1 -128 to 127
int 2 -32768 to 32767
unsigned int 2 0 to 65535
signed int 2 -32768 to 32767
short int 2 -32768 to 32767
unsigned short int 2 0 to 65535
signed short int 2 -32768 to 32767
long int 4 -2147483648 to 2147483647
signed long int 4 -2147483648 to 2147483647
unsigned long int 4 0 to 4294967295
float 4 3.4E-38 to 3.4E+38
double 8 1.7E -308 to 1.7E+308
long double 10 3.4E -4932 to 1.1E +4932
enum 2 -32768 to 32767
bool 1 true / false

APPENDIX C

Precedence of Operators in C++

# Group Operator Operation
1. Top ( )
[]
->

.
Function call
Array subscript
C++ indirect component selector
C++ scope access/resolution
C++ direct component selector
2. Unary !
~
+
-
++
--
&
*
sizeof
new
delete
Logical negation (NOT)
Bitwise (1's) complement
Unary plus
Unary minus
Pre-increment or post-increment
Pre-decrement or post-decrement
Address
Indirection
Returns size of operand in bytes
Dynamically allocates C++ storage
Dynamically deallocates C++ storage
3. Multiplicative *
/
%
Multiply
Divide
Remainder (modulus)
4. Member Access .*
->*
C++ deference
C++ deference
5. Additive +
-
Binary plus
Binary minus
6. Shift <<
>>
Shift left
Shift right
7. Relational <
<=
>
>=
Less than
Less than or equal to
Greater than
Greater than or equal to
8. Equality ==
!=
Equal to
Not equal to
9. Bitwise & Bitwise AND
^ Bitwise XOR
| Bitwise OR
10. logical && Logical AND
|| Logical OR
11. Conditional ?: (a ? x : y means “if a then x, else y”)
12. Assignment
13. Comma
=
*=
/=
%=
+=
-=
&=
^=
|=
<<=
>>=
,
Simple assignment
Assign product
Assign quotient
Assign remainder (modulus)
Assign sum
Assign difference
Assign bitwise AND
Assign bitwise XOR
Assign bitwise OR
Assign left shift
Assign right shift
Evaluate

APPENDIX D

American Standard Code for Information Interchange

APPENDIX E

Scan Codes of Keyboard Keys