Article View: fr.comp.lang.c
Article #15249Re: rot13 [Was : Re: conjugaison et autres ...]
From: Charlie Gordon
Date: Mon, 03 Oct 2005 07:11
Date: Mon, 03 Oct 2005 07:11
32 lines
2509 bytes
2509 bytes
"Harpo" <trashcan@hotmail.com> wrote in message
news:4340d2c9$0$27410$8fcfb975@news.wanadoo.fr...
> Charlie Gordon wrote:
>
> >
> > le cast en (int) de alphabet[i] est inutile, il ne fait rien du tout,
> > de plus alphabet[i] est forc�ment positif, donc inutile de caster en
> > (unsigned char).
>
> C'est vrai en ASCII, pas en EBCDIC.
J'oubliais ce d�tail sordide !
Mais notons que ce n'est pas toujours faux en EBCDIC, �a redevient vrai si les
char font plus de 8 bits, et �a marche si les char sont unsigned par d�faut. Je
serais surpris que ce ne soit pas le cas avec tous les compilateurs port�s sur
ces architectures merdiques.
Mort � EBCDIC, vive ASCII et UNICODE !
> > On peut aussi se passer de rot13_alphabet en �crivant:
> >
> > crypt[alphabet[i]] = alphabet[(i + 13) % 26];
> >
> > Mais c'est l�g�rement plus co�teux sur les rares machines o� la
> > division est lente.
>
> La solution de Candide (tableau de 39 char ('a..z' + 'a..m')) �vite la
> division.
Tout � fait ;-)
--
Chqrlie.
Technical Details
Message-ID:
<dhqk2i$g6k$1@reader1.imaginet.fr>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!newsfeed.stueberl.de!peernews3.colt.net!colt.net!fr.colt.net!writer!not-for-mailReferences:
<1126342327.583568.21420@g43g2000cwa.googlegroups.com> <4329e5d4$0$7846$8fcfb975@news.wanadoo.fr> <dge4b6$fqa$1@reader1.imaginet.fr> <432ab809$0$1734$8fcfb975@news.wanadoo.fr> <mn.84b07d59016a857b.31483@laposte.net> <433f16ac$0$27406$8fcfb975@news.wanadoo.fr> <mn.10907d5a55119e84.15512@YOURBRAnoos.fr> <433f9cb1$0$7821$8fcfb975@news.wanadoo.fr> <mn.128c7d5aa5238de0.15512@YOURBRAnoos.fr> <43403203$0$5388$8fcfb975@news.wanadoo.fr> <43403d27$0$306$7a628cd7@news.club-internet.fr> <dhq3bs$dbc$1@reader1.imaginet.fr> <4340d2c9$0$27410$8fcfb975@news.wanadoo.fr>Show Full Headers
Complete Article Headers
X-Google-Thread: f9822,b21b26167a936e28 X-Google-Attributes: gidf9822,public X-Google-Language: FRENCH,ASCII Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!newsfeed.stueberl.de!peernews3.colt.net!colt.net!fr.colt.net!writer!not-for-mail From: "Charlie Gordon" <news@chqrlie.org> Newsgroups: fr.comp.lang.c Subject: Re: rot13 [Was : Re: conjugaison et autres ...] Date: Mon, 3 Oct 2005 09:11:24 +0200 Organization: ImagiNET / Colt Internet Lines: 34 Message-ID: <dhqk2i$g6k$1@reader1.imaginet.fr> References: <1126342327.583568.21420@g43g2000cwa.googlegroups.com> <4329e5d4$0$7846$8fcfb975@news.wanadoo.fr> <dge4b6$fqa$1@reader1.imaginet.fr> <432ab809$0$1734$8fcfb975@news.wanadoo.fr> <mn.84b07d59016a857b.31483@laposte.net> <433f16ac$0$27406$8fcfb975@news.wanadoo.fr> <mn.10907d5a55119e84.15512@YOURBRAnoos.fr> <433f9cb1$0$7821$8fcfb975@news.wanadoo.fr> <mn.128c7d5aa5238de0.15512@YOURBRAnoos.fr> <43403203$0$5388$8fcfb975@news.wanadoo.fr> <43403d27$0$306$7a628cd7@news.club-internet.fr> <dhq3bs$dbc$1@reader1.imaginet.fr> <4340d2c9$0$27410$8fcfb975@news.wanadoo.fr> NNTP-Posting-Host: gw.netgem.com X-Trace: reader1.imaginet.fr 1128321938 16596 195.68.2.34 (3 Oct 2005 06:45:38 GMT) X-Complaints-To: abuse@imaginet.fr NNTP-Posting-Date: 3 Oct 2005 06:45:38 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1506 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506