🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.unix
Article #151

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

#151
From: Martin Weitzel
Date: Tue, 16 Jan 1990 22:36
20 lines
1322 bytes
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 <stealth.acf.nyu.edu!brnstnd@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@mwtech.UUCP, voice: 49-(0)6151-6 56 83


Volume-Number: Volume 18, Number 21
Technical Details
Message-ID: <508@longway.TIC.COM>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!longway!std-unix
References: <7544@cs.utexas.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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)