Xref: utzoo comp.std.unix:495 comp.lang.c:25135 Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!longway!std-unix From: martin@mwtech.uucp (Martin Weitzel) Newsgroups: comp.std.unix,comp.lang.c Subject: Re: How to convert a char into an int from 0 through 255? Message-ID: <508@longway.TIC.COM> Date: 16 Jan 90 22:36:20 GMT References: <7544@cs.utexas.edu> Sender: std-unix@longway.TIC.COM Reply-To: martin@mwtech.uucp (Martin Weitzel) Followup-To: comp.lang.c Organization: MIKROS Systemware, Darmstadt/W-Germany Lines: 20 Approved: jsq@longway.tic.com (Moderator, John S. Quarterman) From: martin@mwtech.uucp (Martin Weitzel) [ Please send all further articles on this subject to comp.lang.c. -mod ] In article <7544@cs.utexas.edu> Dan Bernstein 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@mwtech.UUCP, voice: 49-(0)6151-6 56 83 Volume-Number: Volume 18, Number 21