Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site udenva.UUCP Path: utzoo!decvax!genrad!panda!talcott!harvard!seismo!hao!nbires!boulder!cisden!udenva!lspirkov From: lspirkov@udenva.UUCP (Goldilocks) Newsgroups: net.lang.c Subject: Re: Quiz for Novice to Intermediate C Users Message-ID: <539@udenva.UUCP> Date: Sun, 21-Apr-85 20:09:02 EST Article-I.D.: udenva.539 Posted: Sun Apr 21 20:09:02 1985 Date-Received: Tue, 23-Apr-85 23:48:04 EST References: <> Reply-To: lspirkov@udenva.UUCP (Goldilocks) Distribution: na Organization: U of Denver Lines: 29 In article <> buls@dataio.UUCP (Rick Buls) writes: > >#define dum(x) /* empty debug macro */ > >main() >{ > printf("foo returns %d\n",foo()); /* print answer */ >} > >foo() >{ > int a,b,*p= &a; /* p points to a */ > > b=10; > *p=2; /* set a to 2 */ > a=b/*p; /* div b by contents of pointer(ie a) */ ^^ > dum(a); > return(a); >} on the line where you have: a=b/*p; /* div b by ... */ the /* between the b and the p is the beginning of the comment, not a div (/) and then a pointer (*). and the answer i got was 10. and that's b/dum(a); (anyone know why dum(a) has the value 1???) Goldi