Re: The joy of octal

Liste des GroupesRevenir à col misc 
Sujet : Re: The joy of octal
De : OFeem1987 (at) *nospam* teleworm.us (Chris Ahlstrom)
Groupes : comp.os.linux.misc
Date : 12. Nov 2024, 13:29:12
Autres entêtes
Organisation : None
Message-ID : <vgvhmp$1j7v5$1@dont-email.me>
References : 1 2 3 4
User-Agent : slrn/1.0.3 (Linux)
Louis Krupp wrote this post while blinking in Morse code:

On 11/11/2024 1:58 PM, Chris Ahlstrom wrote:
John Ames wrote this post while blinking in Morse code:
>
On Sat, 9 Nov 2024 09:36:58 -0500
Chris Ahlstrom <OFeem1987@teleworm.us> wrote:
>
020111 067544 023556 020164 062556 062145 067040 020157 072163 062545
065556 067151 020147 062550 060570 062544 064543 060555 020554 005012
041165 072040 073350 060564 020151 063040 074557 072447 071145 020167
071151 072151 067147 020146 071157 066400 060440 061151 063455 062556
062151 060556 020155 060543 064151 067145 027056 027077
Damn, I still haven't found a program that would easily reverse octal to a
string.
>
>
This is crude, but it seems to work for the post you're replying to,
with big-endian two-byte integers:
>
===
#include <stdio.h>
>
int main(void)
{
     union {
         unsigned short s;
         char c[2];
     } w;
     unsigned int wi;
     char junk;
>
     while (scanf("%o%c", &wi, &junk) > 0) {
         w.s = wi;
         printf("%c%c", w.c[1], w.c[0]);
     }
     printf("\n");
>
     return 0;
}
===
>
To read a sequence of two-byte octal little-endian integers, swap w.c[1]
and w.c[0].

Thanks!

--
After all, what is your hosts' purpose in having a party?  Surely not for
you to enjoy yourself; if that were their sole purpose, they'd have simply
sent champagne and women over to your place by taxi.
-- P. J. O'Rourke

Date Sujet#  Auteur
9 Nov 24 * The joy of octal66Chris Ahlstrom
11 Nov 24 `* Re: The joy of octal65John Ames
11 Nov 24  +* Re: The joy of octal49Chris Ahlstrom
12 Nov 24  i+* Re: The joy of octal47Chris Ahlstrom
12 Nov 24  ii`* Re: The joy of EBCDIC46John Ames
12 Nov 24  ii +* Re: The joy of EBCDIC3Chris Ahlstrom
12 Nov 24  ii i`* Re: The joy of EBCDIC2candycanearter07
13 Nov 24  ii i `- Re: The joy of EBCDIC1Chris Ahlstrom
14 Nov 24  ii `* Re: The joy of EBCDIC42Fritz Wuehler
14 Nov 24  ii  `* Re: The joy of EBCDIC41Clemens Schüller
15 Nov 24  ii   `* Re: The joy of EBCDIC40Eli the Bearded
15 Nov 24  ii    `* Re: The joy of pipes39John Ames
15 Nov 24  ii     +* Re: The joy of pipes37Lawrence D'Oliveiro
15 Nov 24  ii     i`* Re: The joy of pipes36186282@ud0s4.net
15 Nov 24  ii     i +- Re: The joy of pipes1John Ames
16 Nov 24  ii     i +- Re: The joy of pipes1Lawrence D'Oliveiro
16 Nov 24  ii     i +* Re: The joy of pipes2Robert Riches
16 Nov 24  ii     i i`- Re: The joy of pipes1Lawrence D'Oliveiro
16 Nov 24  ii     i +* Re: The joy of pipes4186282@ud0s4.net
16 Nov 24  ii     i i`* Re: The joy of pipes3rbowman
16 Nov 24  ii     i i `* Re: The joy of pipes2186282@ud0s4.net
17 Nov 24  ii     i i  `- Re: The joy of pipes1186282@ud0s4.net
16 Nov 24  ii     i `* Re: The joy of pipes27Richard Kettlewell
17 Nov 24  ii     i  `* Re: The joy of pipes26186282@ud0s4.net
17 Nov 24  ii     i   +* Re: The joy of pipes4Lawrence D'Oliveiro
17 Nov 24  ii     i   i`* Re: The joy of pipes3186282@ud0s4.net
17 Nov 24  ii     i   i `* Re: The joy of pipes2Lawrence D'Oliveiro
17 Nov 24  ii     i   i  `- Re: The joy of pipes1186282@ud0s4.net
17 Nov 24  ii     i   `* Re: The joy of pipes21Richard Kettlewell
18 Nov 24  ii     i    `* Re: The joy of pipes20186282@ud0s4.net
18 Nov 24  ii     i     +* Re: The joy of pipes17Lawrence D'Oliveiro
18 Nov 24  ii     i     i`* Re: The joy of pipes16186282@ud0s4.net
18 Nov 24  ii     i     i `* Re: The joy of pipes15Pancho
18 Nov 24  ii     i     i  +* Re: The joy of pipes13Lawrence D'Oliveiro
18 Nov 24  ii     i     i  i`* Re: The joy of pipes12Pancho
18 Nov 24  ii     i     i  i +* Re: The joy of pipes8The Natural Philosopher
18 Nov 24  ii     i     i  i i+* Re: The joy of pipes3Pancho
18 Nov 24  ii     i     i  i ii+- Re: The joy of pipes1The Natural Philosopher
18 Nov 24  ii     i     i  i ii`- Re: The joy of pipes1rbowman
19 Nov 24  ii     i     i  i i`* Re: The joy of pipes4186282@ud0s4.net
19 Nov 24  ii     i     i  i i +- Re: The joy of pipes1Lawrence D'Oliveiro
19 Nov 24  ii     i     i  i i +- Re: The joy of pipes1The Natural Philosopher
19 Nov 24  ii     i     i  i i `- Re: The joy of pipes1Richard Kettlewell
18 Nov 24  ii     i     i  i `* Re: The joy of pipes3rbowman
19 Nov 24  ii     i     i  i  `* Re: The joy of pipes2Pancho
19 Nov 24  ii     i     i  i   `- Re: The joy of pipes1Lawrence D'Oliveiro
19 Nov 24  ii     i     i  `- Re: The joy of pipes1186282@ud0s4.net
19 Nov 24  ii     i     `* Re: The joy of pipes2Robert Riches
19 Nov 24  ii     i      `- Re: The joy of pipes1Lawrence D'Oliveiro
15 Nov 24  ii     `- Re: The joy of pipes1Eli the Bearded
12 Nov 24  i`- Re: The joy of octal1Eli the Bearded
12 Nov 24  `* Re: The joy of octal15Fritz Wuehler
15 Nov 24   `* Re: The joy of octal14186282@ud0s4.net
15 Nov 24    `* Re: The joy of octal13rbowman
16 Nov 24     +* Re: The joy of octal7186282@ud0s4.net
16 Nov 24     i`* Re: The joy of octal6rbowman
16 Nov 24     i `* Re: The joy of octal5186282@ud0s4.net
16 Nov 24     i  +* Re: The joy of octal2Don_from_AZ
17 Nov 24     i  i`- Re: The joy of octal1186282@ud0s4.net
16 Nov 24     i  `* Re: The joy of octal2rbowman
17 Nov 24     i   `- Re: The joy of octal1186282@ud0s4.net
16 Nov 24     `* Re: The joy of octal5186282@ud0s4.net
16 Nov 24      +- Re: The joy of octal1rbowman
16 Nov 24      `* Re: The joy of octal3Andreas Eder
16 Nov 24       `* Re: The joy of octal2The Natural Philosopher
17 Nov 24        `- Re: The joy of octal1186282@ud0s4.net

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal