Path: utzoo!utgpu!watmath!att!pacbell!ames!indri!uakari.primate.wisc.edu!csd4.milw.wisc.edu!cs.utexas.edu!usc!bbn!bbn.com!levin From: levin@bbn.com (Joel B Levin) Newsgroups: comp.sys.mac.programmer Subject: Re: Seemingly equivalent code fragments in C Keywords: C pointers Lightspeed int Message-ID: <43933@bbn.COM> Date: 7 Aug 89 20:28:54 GMT References: <4882@tank.uchicago.edu> Sender: news@bbn.COM Reply-To: levin@BBN.COM (Joel B Levin) Organization: BBN Communications Corporation Lines: 23 In article <4882@tank.uchicago.edu> s170@tank.uchicago.edu (harmon g washington) writes: I'm no C wiz but at least here is one I know... |In programming the Macintosh apple menu I tried to create the Apple symbol usingthe following code: | void MenuInits() |{ | int *bittenApple; You have defined a pointer to an int. | | *bittenApple = 0x0114; /* create Pascal string 1 byte long */ You have placed 0x0114 into the location pointed to by bittenApple, but you have not initialized bittenApple; so you have changed the contents of some random loaction. |THIS CODE DID NOT WORK! . . . = UUCP: levin@bbn.com (new) or {backbone}!bbn!levin (old) INTERNET: levin@bbn.com POTS: (617) 873-3463 "The night was"