Path: utzoo!mnetor!uunet!husc6!mit-eddie!uw-beaver!tikal!hplsla!hpubvwa!mimsy!chris From: chris@mimsy Newsgroups: comp.lang.c Subject: pointer arithmatic error messages Message-ID: <9979@mimsy> Date: 30 Dec 87 13:18:00 GMT Lines: 29 In article <3899@uw-june.UUCP>, pardo@uw-june.UUCP (David Keppel) writes: >typedef int foo; [...] > foo *a, *b, *c; > a = b + c; > b += c > if ((c += a) != b) > a = b; > >Pcc complains about *every* operator excpet the last "=" (yes, even "!="). It complains about the `!=' because you confused with with the `+=' (it lost the type of c). >I would like to know: > why? Because it is meaningless to add two pointers. > how can I make it work? (yes, I really want to do "b+=c") What do you expect to happen? > how can I make it work without doing "((int) b) += (int) c"? That depends on what you want done. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7690) Domain: chris@mimsy.umd.edu Path: uunet!mimsy!chris