Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2018-01

Initialize records C style

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

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}
};

Reply by email

Marco van de Voort
to Darius Blaszyk

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.

Reply by email