Initialize records C style

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Initialize records C style

Darius Blaszyk
I have this code in C, the variable p is a 20 element array. However
only the first two items are initialized. Is this possible in pascal as
well?

TIA, Darius

struct point {
    int    x;
    int    y;
};

struct point p[20]= {
     {0, 100},
     {3,1}
};
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Initialize records C style

Marco van de Voort
In our previous episode, Darius Blaszyk said:
> I have this code in C, the variable p is a 20 element array. However
> only the first two items are initialized. Is this possible in pascal as
> well?

No, all or nothing.
 
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal