🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c.moderated
Article #1982

Re: Good C Interview questions?

#1982
From: Tanmoy Bhattacharya
Date: Thu, 15 Feb 1996 13:57
25 lines
1574 bytes
In article <4fu8cu$9js@solutions.solon.com> tanmoy@qcd.Lanl.GOV
(Tanmoy Bhattacharya) writes: 
<snip>
   Careful. S1[i] < S2[i] is possible.

   Careful. Why assume ASCII? If S1[i] is guaranteed larger than S2[i],

     " ABCDEFGHIJKLMNOPQRSTUVWXYZ"[ (unsigned)(S1[i] - S2[i]) <= 26?
				    (S1[i]-S2[i]+1) : 0 ]

   makes no further assumption. The obfuscation can ofcourse be trivially
   removed.

It is not only the moderator that needs sleep it seems. It makes the
assumption that the implementation is not bizarre.

Cheers
Tanmoy
--
tanmoy@qcd.lanl.gov(128.165.23.46) DECNET: BETA::"tanmoy@lanl.gov"(1.218=1242)
Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87545 H:#9,3000,Trinity Drive,NM87544
Others see <gopher://yaleinfo.yale.edu:7700/00/Internet-People/internet-mail>,
<http://alpha.acast.nova.edu/cgi-bin/inmgq.pl>or<ftp://csd4.csd.uwm.edu/pub/
internetwork-mail-guide>. -- <http://nqcd.lanl.gov/people/tanmoy/tanmoy.html>
fax: 1 (505) 665 3003   voice: 1 (505) 665 4733    [ Home: 1 (505) 662 5596 ]
Technical Details
Message-ID: <4fve4r$dmm@solutions.solon.com>
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
References: <4emaqj$3ng@solutions.solon.com> <4ep1s1$5se@solutions.solon.com> <4fjnch$oqq@solutions.solon.com> <4fp1ks$h6r@solutions.solon.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
From: tanmoy@qcd.Lanl.GOV (Tanmoy Bhattacharya)
Newsgroups: comp.lang.c.moderated
Subject: Re: Good C Interview questions?
Date: 15 Feb 1996 07:57:47 -0600
Organization: Los Alamos National Laboratory
Sender: clc@solutions.solon.com
Approved: clc@solutions.solon.com
Message-ID: <4fve4r$dmm@solutions.solon.com>
References: <4emaqj$3ng@solutions.solon.com> <4ep1s1$5se@solutions.solon.com>
 <4fjnch$oqq@solutions.solon.com> <4fp1ks$h6r@solutions.solon.com>
NNTP-Posting-Host: solutions.solon.com