Note: Logical operators (AND/OR/XOR etc) are logical or boolean depending on the type of the arguments (boolean or integer). Since Pascal had a separate boolean type from the start, boolean operators on integers were not necessary, and are always logical.
C type |
Pascal type |
Size (bits) |
Range |
Notes |
char |
Char |
8-bit |
|
ASCII |
signed char |
Shortint |
8-bit |
-128 .. 127 |
|
unsigned char |
Byte |
8-bit |
0 .. 255 |
|
char* |
PChar |
(32-bit) |
|
Pointer to a null-terminated string |
short int |
Smallint |
16-bit |
-32768 .. 32767 |
|
unsigned short int |
Word |
16-bit |
0 .. 65535 |
|
int |
Integer |
(16-bit or) 32-bit |
-2147483648..2147483647 |
Generic integer types |
unsigned int |
Cardinal |
(16-bit or) 32-bit |
0 .. 4294967295 |
Generic integer types |
long int |
Longint |
32-bit |
-2147483648..2147483647 |
|
unsigned long int |
Longword |
32-bit |
0 .. 4294967295 |
|
float |
Single |
32-bit |
1.5E-45 .. 3.4E+38 |
|
double |
Double |
64-bit |
5.0E-324 .. 1.7E+308 |
|
unsigned long long |
QWord |
64-bit |
0 .. 18446744073709551615 |
|
Assignment Operators
Operator C |
Description |
Example |
= |
Simple assignment operator. Assigns values from right side operands to left side operand |
C = A + B is equivalent to pascal C:= A + B |
+= |
Add AND assignment operator. It adds the right operand to the left operand and assign the result to the left operand. |
C += A is equivalent to pascal C:= C + A |
-= |
Subtract AND assignment operator. It subtracts the right operand from the left operand and assigns the result to the left operand. |
C -= A is equivalent to pascal C := C - A |
*= |
Multiply AND assignment operator. It multiplies the right operand with the left operand and assigns the result to the left operand. |
C *= A is equivalent to pascal C := C * A |
/= |
Divide AND assignment operator. It divides the left operand with the right operand and assigns the result to the left operand. |
C /= A is equivalent to pascal C := C / A |
%= |
Modulus AND assignment operator. It takes modulus using two operands and assigns the result to the left operand. |
C %= A is equivalent to pascal C := C mod A |
&= |
Bitwise AND assignment operator. |
C &= 2 is equivalent to pascal C := C and 2 |
^= |
Bitwise exclusive OR and assignment operator. |
C ^= 2 is equivalent to pascal C := C or not 2 |
|= |
Bitwise inclusive OR and assignment operator. |
C |= 2 is equivalent to pascal C := C or 2 |
note: in free pascal you may not convert the following operators (+= , -= , *= , /=)
Escape sequence |
Hex value in ASCII |
Character represented |
? |
3F |
Question mark (used to avoid trigraphs) |
' |
27 |
Apostrophe or single quotation mark |
" |
22 |
Double quotation mark |
\ |
5C |
Backslash |
\a |
07 |
Alert (Beep, Bell) (added in C89) |
\b |
08 |
Backspace |
\e |
1B |
Escape character |
\f |
0C |
Formfeed Page Break |
\n |
0A |
Newline (Line Feed); see notes below |
\nnn |
any |
The byte whose numerical value is given by nnn interpreted as an octal number |
\r |
0D |
Carriage Return |
\t |
09 |
Horizontal Tab |
\uhhhh |
none |
Unicode code point below 10000 hexadecimal (added in C99)[1]: 26 |
\Uhhhhhhhh |
none |
Unicode code point where h is a hexadecimal digit |
\v |
0B |
Vertical Tab |
\xhh… |
any |
The byte whose numerical value is given by hh… interpreted as a hexadecimal number |