Sujet : Re: macro for fir list?
De : fir (at) *nospam* grunge.pl (fir)
Groupes : comp.lang.cDate : 28. Mar 2024, 15:01:05
Autres entêtes
Organisation : i2pn2 (i2pn.org)
Message-ID : <uu3t72$3b0f5$1@i2pn2.org>
References : 1 2
User-Agent : Mozilla/5.0 (Windows NT 5.1; rv:27.0) Gecko/20100101 Firefox/27.0 SeaMonkey/2.24
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);
}