Path: utzoo!attcan!utgpu!watmath!att!dptg!rutgers!cs.utexas.edu!uunet!mcvax!ukc!castle!lfcs!nick
From: nick@lfcs.ed.ac.uk (Nick Rothwell)
Newsgroups: comp.sys.mac.programmer
Subject: Re: Seemingly equivalent code fragments in C
Keywords: C pointers Lightspeed int
Message-ID: <34@castle.ed.ac.uk>
Date: 8 Aug 89 14:37:13 GMT
References: <4882@tank.uchicago.edu>
Sender: root@castle.ed.ac.uk
Reply-To: nick@lfcs.ed.ac.uk (Nick Rothwell)
Organization: LFCS Enya Admiration Society
Lines: 28
In-reply-to: s170@tank.uchicago.edu (harmon g washington)

In article <4882@tank.uchicago.edu>, s170@tank (harmon g washington) writes:
>In programming the Macintosh apple menu I tried to create the Apple symbol usingthe following code:
>	void MenuInits()
>{
>	int *bittenApple;
>	
>	*bittenApple = 0x0114;  	/* create Pascal string 1 byte long */
>	AppleMenu = NewMenu(ApplID, bittenApple);
>	.
>	.
>} /* menuinits() */
>
>THIS CODE DID NOT WORK!

...because it's faulty. You're declaring a pointer to integers
(bittenApple) without pointing it at anything. You're then assigning
the thing the pointer points at (viz. nothing) with 0x0114.  Judging
from my own personal experiences, you're probably done something like
shooting the Menu Manager through the head.

>	--- Harmon Washington

		Nick.
--
Nick Rothwell,	Laboratory for Foundations of Computer Science, Edinburgh.
		nick@lfcs.ed.ac.uk    !mcvax!ukc!lfcs!nick
~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~ ~~
               Fais que ton reve soit plus long que la nuit.