Fundamentals of CS I (CS151 2001S) : Reference

char->integer - determine the collating sequence number of a character

Parametersc, a character
PurposeDetermines the collating sequence number of a character.
Producesi integer that corresponds to the sequence number of c.
PreconditionsOnly one parameter (verified).
c is a character (verified).
PostconditionsThe result is an integer.
(integer->char i) is c.
> (char->integer #\t)
> (char->integer #\u)
> (char->integer #\T)
> (char->integer #\?)
> (char->integer 4)
char->integer: expects argument of type <character>; given 4
> (integer->char (+ (char->integer #\a) 2))
> (integer->char (+ (char->integer #\A) 2))
See Also

Disclaimer: I usually create these pages on the fly. This means that they are rarely proofread and may contain bad grammar and incorrect details. It also means that I may update them regularly (see the history for more details). Feel free to contact me with any suggestions for changes.

This page was generated by Siteweaver on Thu Feb 22 05:47:49 2001.
This page may be found at
You may validate this page's HTML.
The source was last modified Sun Feb 4 10:21:11 2001.