Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / multiple and dynamic arrays

Author
Message
westray
21
Years of Service
User Offline
Joined: 10th Oct 2002
Location: Falkirk,Scotland
Posted: 14th Dec 2008 15:38
How would you create multiple index arrays and dynamic arrays in DarkGDK?
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 14th Dec 2008 16:19
Not sure about multiple index arrays, maybe maps. But indexes are positional things and I guess what you really would need would be a class that includes the data and whatever values you're indexing with. I would think they wouldn't be time efficient though

Dynanmic arrays are usually handled by vectors. This is all under C++. C# might have some collection classes that do a better job.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 14th Dec 2008 16:46
Single dimensional arrays, dynamic or not, are probably best handled by the vector class.

Multidimensional arrays can be handled by writing a wrapper around vector, and this is what I've done in the past - it's a pain growing the individual vectors that make it up when you expand a dimension though.

Recently, I've been looking at the Boost Multi-Array class - this allows any number of dimensions, and allows you to resize them dynamically. The downside (slight though it is) is a little more complexity - the Introductory page tells you most of what you'll need to know. It's a header-only library, so once you '#include' it, you're good to go.

Login to post a reply

Server time is: 2024-09-30 13:14:09
Your offset time is: 2024-09-30 13:14:09