Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!ernie.Berkeley.EDU!jas From: jas@ernie.Berkeley.EDU (Jim Shankland) Newsgroups: comp.lang.c Subject: Re: When is a cast not a cast? Message-ID: <29236@ucbvax.BERKELEY.EDU> Date: 19 May 89 19:08:48 GMT References: <2747@buengc.BU.EDU> <10191@smoke.BRL.MIL> <406@skye.ed.ac.uk> <10276@smoke.BRL.MIL> <2890@buengc.BU.EDU> <10282@smoke.BRL.MIL> <2051@unisoft.UUCP> <2919@buengc.BU.EDU> Sender: usenet@ucbvax.BERKELEY.EDU Reply-To: jas@ernie.Berkeley.EDU (Jim Shankland) Organization: University of California, Berkeley Lines: 25 In article <2919@buengc.BU.EDU> bph@buengc.bu.edu (Blair P. Houghton) writes: >... a semanticist or a professional computer scientist ... neither >of which I am. I'm just a C-coding hacknut with a yen to see two pointers >added together. This much is abundantly clear. You want to add two pointers together? You can. Here's how: char *cp1, *cp2, *cp3; ... cp3 = (char *) ((unsigned long) cp1 + (unsigned long) cp2); If you could do it a little less noisily than you have been :-(, many of us would appreciate it. Oh, and don't expect your code to be portable. The above code has no meaning that is independent of a particular hardware platform. That's not C's fault, either. If you don't understand why not, then for Christ's sake, pick up a book or take a course or something. Posting inane analogies and gratuitously insulting people who know more about this than you do is a poor way to arrive at understanding. Jim Shankland jas@ernie.berkeley.edu "Blame it on the lies that killed us, blame it on the truth that ran us down"