Path: utzoo!attcan!uunet!samsung!think!bbn!granite!buck From: buck@granite.cr.bull.com (Ken Buck) Newsgroups: comp.lang.c Subject: Re: Brain Teaser Message-ID: <1990Mar28.194154.20262@granite.cr.bull.com> Date: 28 Mar 90 19:41:54 GMT References: <99@demott.COM> Reply-To: buck@granite.cr.bull.com (Ken Buck) Organization: Bull HN Information Systems Inc. Lines: 13 In article <99@demott.COM> kdq@demott.COM (Kevin D. Quitt) writes: [re: the 'swap()' brain teaser] > Disclaimer: This assumes that pointers are not longer than longs (or >some other defined type). On the other hand, how many machines do you >know that have longer addresses than data? Hate to rain on your parade, but machines which don't implement byte addressing will cause you problems! In these cases, char pointers are implemented as a word address (typically 32 bits) plus a byte offset (perhaps 16 bits), hence we have a pointer type which is bigger than a long. Trust me - these things exist! :-) (Of course, this is not meant to dampen the spirits of ingenious problem-solving - just realize that your solution is not portable...)