Character codes: Difference between revisions

Content added Content deleted
m (Minor cleanup)
(→‎{{header|OCaml}}: also Char module)
Line 525: Line 525:
<lang ocaml>Printf.printf "%d\n" (int_of_char 'a'); (* prints "97" *)
<lang ocaml>Printf.printf "%d\n" (int_of_char 'a'); (* prints "97" *)
Printf.printf "%c\n" (char_of_int 97); (* prints "a" *)</lang>
Printf.printf "%c\n" (char_of_int 97); (* prints "a" *)</lang>

We also have these functions:
<lang># Char.code ;;
- : char -> int = <fun>
# Char.chr;;
- : int -> char = <fun></lang>


=={{header|OpenEdge/Progress}}==
=={{header|OpenEdge/Progress}}==