Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site rochester.UUCP Path: utzoo!linus!decvax!harpo!seismo!rochester!stuart From: stuart@rochester.UUCP (Stuart Friedberg) Newsgroups: net.lang.c Subject: Re: mixing pointers and arrays Message-ID: <2601@rochester.UUCP> Date: Tue, 16-Aug-83 21:46:27 EDT Article-I.D.: rocheste.2601 Posted: Tue Aug 16 21:46:27 1983 Date-Received: Wed, 17-Aug-83 05:34:28 EDT References: <1737@allegra.UUCP>, <1795@umcp-cs.UUCP>, <191@cbosgd.UUCP> Organization: U. of Rochester, CS Dept. Lines: 16 I recently ran afoul of the difference in treatment of structures and arrays. I had an array which was passed to an image processing program to be filled with the locations of all the boundary points of an image. The call was BoundaryPoints(Image, Bounds). (Image and Bounds both arrays). I then decided to have BoundaryPoints calculate a few related values like centroid and "mass" of the interesting part of the image. I changed Bounds to be a struct including the earlier array and adding variables for the new info. I updated all the references to Bounds, but left the call alone. Surprise, surprise! It all compiled, but previously working code crashes. Well, it rapidly became clear that the structure was being passed by value, not reference, but I did think that it was an unnecessary "gotcha". Shades of the uniform reference problem!!! Stu Friedberg