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

Username:   Password: 
 RegisterRegister   
 error: Not enough memory for dynamic array allocation
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
smool




PostPosted: Tue Mar 05, 2013 9:41 pm   Post subject: error: Not enough memory for dynamic array allocation

So I have the following code:

Turing:

var n : int
get n
var primestemp : array 2 .. n of boolean


My problem is that when ever I enter 5000000, I get that error. It happens right at the start, right on the line 'var primestemp : array 2 .. n of boolean'. Is there any way around this? Or do I have use a linked list structure?
Please specify what version of Turing you are using
Open Turing
Sponsor
Sponsor
Sponsor
sponsor
Insectoid




PostPosted: Tue Mar 05, 2013 10:19 pm   Post subject: RE:error: Not enough memory for dynamic array allocation

The problem is simple. Turing can't allocate an array that big. Why would you need one anyway?
Raknarg




PostPosted: Wed Mar 06, 2013 7:59 pm   Post subject: RE:error: Not enough memory for dynamic array allocation

Probably for CCC2013, question 5. Needs to be able to take in a lot of numbers.
Insectoid




PostPosted: Wed Mar 06, 2013 8:04 pm   Post subject: RE:error: Not enough memory for dynamic array allocation

Even so, you shouldn't need all of those numbers at once.
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  [ 4 Posts ]
Jump to:   


Style:  
Search: