Xref: utzoo comp.lang.c:37737 talk.bizarre:65766 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!samsung!umich!sharkey!amara!mcdaniel From: mcdaniel@adi.com (Tim McDaniel) Newsgroups: comp.lang.c,talk.bizarre Subject: Re: Pass the Marmalade (Re: How to write a sorting program that will sort everything?) Message-ID: Date: 29 Mar 91 18:19:46 GMT References: <1991Mar23.164807.7318@helios.physics.utoronto.ca> <3418@inews.intel.com> <2052@necisa.ho.necisa.oz.au> <3493@inews.intel.com> Sender: news@adi.COM Followup-To: comp.lang.c Organization: Applied Dynamics International, Inc.; Ann Arbor, Michigan, USA Lines: 29 In-reply-to: bhoughto@pima.intel.com's message of 27 Mar 91 09:54:21 GMT In article <3493@inews.intel.com> bhoughto@pima.intel.com (Blair P. Houghton) writes: The real problem here is that you pass only a pointer to the array of strudel, which means that qfat(3) can scribble all over it in colored icing and slice off thick pieces for itself. ... because passing a *pointer to an array* of strudel is almost certainly NOT what you want. Simply pass the address of the zeroth strudel, and qfat() will munch down each one in turn. In C, you can just use the name of the array of strudel, because of *** THE RULE *** "In an eat-value context, a is converted to . Any use of a strudel is an eat-value context, except for * declaring a strudel * initializing a strudel * determining the size of a strudel" And what *do* you get when you add two strudel? If you get a strudel with twice the size, I guarantee you'll get overflow and a core dump. -- "Of course he has a knife. We all have knives. It's 1183, and we're all barbarians." Tim McDaniel Applied Dynamics Int'l.; Ann Arbor, Michigan, USA Internet: mcdaniel@adi.com UUCP: {uunet,sharkey}!amara!mcdaniel