Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: two chars at once... Message-ID: <11057@smoke.BRL.MIL> Date: 14 Sep 89 11:30:34 GMT References: Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 17 In article sr16+@andrew.cmu.edu (Seth Benjamin Rothenberg) writes: >One of the nasty things it does is treat 2 characters >as a single 2-byte integer. > if "ax" = mystr -> if mystr[1]=>C1D9 (or something like that) > mystr = "AX" >Should I just change this call to use macros, like > if cmp2("ax", mystr); > cpy2(mystr, "AX"); >or is a more direct (kludgy?) way possible? The direct equivalent in C would be to use multi-character character constants such as 'AX', which are ints containing the multiple character codes "somehow". The details of how they are represented are implementation-dependent; however, it is probable that 'AX' would be equal to either 'A'<