How to convert a char into an int from 0 through 255?

Martin Weitzel martin at mwtech.uucp
Wed Jan 17 09:36:20 AEST 1990


From: martin at mwtech.uucp (Martin Weitzel)

[ Please send all further articles on this subject to comp.lang.c.  -mod ]

In article <7544 at cs.utexas.edu> Dan Bernstein <stealth.acf.nyu.edu!brnstnd at longway.tic.com> writes:
[some lines deleted]
>handle machines with more than 256 characters. There's no compile-time
>way to find the right bit pattern---UCHAR_MAX + 1 may not be a power of
>two.

Look at my recent posting about a portable 'offsetof()'-Makro.
The general principle outlined there, is almost allways usable
in any situation, where you have a way to solve a problem at
run time, but you need the answer at compile time.

-- 
Martin Weitzel, email: martin at mwtech.UUCP, voice: 49-(0)6151-6 56 83


Volume-Number: Volume 18, Number 21



More information about the Comp.lang.c mailing list