Path: utzoo!mnetor!uunet!husc6!mit-eddie!ll-xn!adelie!munsell!pac From: pac@munsell.UUCP (Paul Czarnecki) Newsgroups: comp.unix.questions Subject: Re: Wierd Compilers Message-ID: <1440@pinney.munsell.UUCP> Date: 21 Dec 87 19:08:07 GMT References: <10861@brl-adm.ARPA> Reply-To: pac@pinney.UUCP (Paul Czarnecki) Organization: Eikonix Corp., Bedford, MA Lines: 34 In article <10861@brl-adm.ARPA> rbj@icst-cmr.arpa (Root Boy Jim) writes: >I always thought that the `do ... while();' syntax was a gratuitous I had also thought that way. But after 5 years of C I finally wrote my first do{}while loop. (I had to look it up!) For one of my libraries, I treat a "picture" as a collection of images. They are held in a doubly linked list in the "picture" structure. If I want to "process" each of the images in a picture I use this code: image_list_2 = image_list_1 = pic->image_list; /* * process each of the subimages */ do { retcode = process_image(image_list_2->image); if (retcode <= 0) { return (EPROCESSFAILED); } image_list_2 = image_list_2->next; /* next images */ } while (image_list_1 != image_list_2); There *are* some applications that a do{}while are natural for. There just aren't many of them. pZ -- Paul Czarnecki -- Spam, spam, spam, Usenet, and spam {{harvard,ll-xn}!adelie,{decvax,allegra,talcott}!encore}!munsell!pz