Computer Science Canada

Flexible arrays in Records

Author:  Raknarg [ Tue Apr 05, 2011 4:03 pm ]
Post subject:  Flexible arrays in Records

Whenever I try to put a flexible array in a record, it tells me "syntax error at 'flexible'". Is there a way to fix this?
This is essentially my code:

Turing:

type thingy :
     record
          x : flexible array 1 .. 5 of int
     end record

Author:  Tony [ Tue Apr 05, 2011 4:05 pm ]
Post subject:  RE:Flexible arrays in Records

a record's size (memory space) must be known at compile time. Since a flexible array could change that, that is not a valid syntax. You could have a pointer to a flexible array allocated elsewhere though.

Author:  Raknarg [ Tue Apr 05, 2011 4:19 pm ]
Post subject:  RE:Flexible arrays in Records

Nah, thats fine, I'll just have it separate :/ thanks


: