Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Flexible arrays in Records
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Raknarg




PostPosted: 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
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: 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.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Raknarg




PostPosted: Tue Apr 05, 2011 4:19 pm   Post subject: RE:Flexible arrays in Records

Nah, thats fine, I'll just have it separate :/ thanks
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: