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

Username:   Password: 
 RegisterRegister   
 flexible array of a class?
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
gg900




PostPosted: Sat Mar 08, 2008 10:24 pm   Post subject: flexible array of a class?

how would I resize a flexible array of a class. they both use 'new' in a differnt way.
Sponsor
Sponsor
Sponsor
sponsor
Saad




PostPosted: Sat Mar 08, 2008 10:40 pm   Post subject: RE:flexible array of a class?

Turing:
class Foo
    %% The class
end Foo

var bar : flexible array 1 .. 10 of ^Foo  %% Create an array of Foo pointers
for i : 1 .. 10
    new bar (i)  %% Create 5 Foo's
end for

for i : 5 .. 10
    free bar (i)  %% Free the Foo's before we resize the array
end for
new bar, 4  %% Change array Size
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  [ 2 Posts ]
Jump to:   


Style:  
Search: