Deutsch English Français Italiano |
<uu3t72$3b0f5$1@i2pn2.org> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!weretis.net!feeder8.news.weretis.net!feeder6.news.weretis.net!i2pn.org!i2pn2.org!.POSTED!not-for-mail From: fir <fir@grunge.pl> Newsgroups: comp.lang.c Subject: Re: macro for fir list? Date: Thu, 28 Mar 2024 15:01:05 +0100 Organization: i2pn2 (i2pn.org) Message-ID: <uu3t72$3b0f5$1@i2pn2.org> References: <uu3s0m$3av2s$1@i2pn2.org> <uu3sca$3av2s$2@i2pn2.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Thu, 28 Mar 2024 14:01:07 -0000 (UTC) Injection-Info: i2pn2.org; logging-data="3506661"; mail-complaints-to="usenet@i2pn2.org"; posting-account="+ydHcGjgSeBt3Wz3WTfKefUptpAWaXduqfw5xdfsuS0"; User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:27.0) Gecko/20100101 Firefox/27.0 SeaMonkey/2.24 X-Spam-Checker-Version: SpamAssassin 4.0.0 In-Reply-To: <uu3sca$3av2s$2@i2pn2.org> Bytes: 1662 Lines: 31 fir wrote: > (bump to see this thread on narkive to see it from phone, weird narkive > dont show threads with only 1 post) there is hovever yet such weir option its weird though convenient struct Fir_List_Entry {int x, y;}; Fir_List_Entry* Fir_List = NULL; int Fir_List_Size = 0; Fir_List_Entry* Fir_List_New() { Fir_List = (Fir_List_Entry*) realloc(Fir_List, ++Fir_List_Size * sizeof(Fir_List_Entry) ); return &Fir_List[Fir_List_Size-1]; } void Test() { *(Fir_List_New()) = {1,2}; *(Fir_List_New()) = {3,4}; *(Fir_List_New()) = {5,6}; for(int i=0; i<Fir_List_Size; i++) printf("\n %d %d", Fir_List[i].x, Fir_List[i].y); }