Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!mailrus!rutgers!uwvax!dogie!uwmcsd1!marque!gryphon!edk From: edk@gryphon.CTS.COM (Ed Kaulakis) Newsgroups: comp.lang.c Subject: Re: Teaching const Message-ID: <3398@gryphon.CTS.COM> Date: 17 Apr 88 15:51:00 GMT Organization: Trailing Edge Technology, Redondo Beach, Ca. Lines: 23 Summary: Someone is missing something... is it me? > To teach this, it is probably easiest to draw the old memory 'boxes' and > show what is held where. For instance, (sizeof(int)==2, sizeof(int*)==4): > > int * const a; ("a" is located @ 100 and contains address 200) > int b[1]; ("b" is located @ 104, "b"'s value is 104) > > *a = *b; (value taken from 104, put in address @100) > > 100 200 > +-+-+-+-+ +-+-+ > | 200 | |*a | > +-+-+-+-+ +-+-+ > 104 > +-+-+ > | 0 | > +-+-+ > > Craig > -- > Craig Schmackpfeffer @ S.R. Systems > {allegra,rutgers,ames}!rochester!srs!craig Uuuh... How did a get that 200 value? A const pointer declaration without an initializer seems somehow odd to me...