FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Dynamic Allocation of Rectangular Arrays

 
Post new topic   Reply to topic     Forum Index -> General
View previous topic :: View next topic  
Author Message
jaker49



Joined: 19 Jun 2009
Posts: 4

PostPosted: Fri Jun 19, 2009 4:22 pm    Post subject: Dynamic Allocation of Rectangular Arrays Reply with quote

Howdy y'all. I'm new to D (coming from C++, Python, and Oberon).

The D doc says we can do this;
float [] [] matrix;

But it doesn't say how to dynamically allocate. How do I allocate for a 3x4 matrix?

matrix = new float ?????

Thanks (in advance).
Back to top
View user's profile Send private message
csauls



Joined: 27 Mar 2004
Posts: 278

PostPosted: Sat Jun 20, 2009 12:53 pm    Post subject: Reply with quote

float[][] matrix = new float[][](3, 4);
_________________
Chris Nicholson-Sauls
Back to top
View user's profile Send private message AIM Address Yahoo Messenger
jaker49



Joined: 19 Jun 2009
Posts: 4

PostPosted: Sat Jun 20, 2009 2:37 pm    Post subject: Reply with quote

That's exactly what I needed. Thanks.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> General All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group