DGArray

Previous topic - Next topic

bigsofty

What is DGArray?  It looks similar to STLs List or Vector?

Is there some docs or and example, perhaps showing creation, traversing, adding, inserting and deleting. Pure C is fine as I am thinking that it should be good for a C++ dynamic array I need to create. It looks, to me at least, like the preferred GLB way of using C++ dynamic arrays/lists in inline C++ but I am unsure of the correct syntax.

Any help is greatly appreciated!  :)
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

Kitty Hello

DGArray is a template container class. You can use:
Code (glbasic) Select

DGArray<anthing> myarray;

// allocation
DIM(myarray, 100);
// or:
DIMPUSH(myarray, thing);

DIMDEL(myarray, index);

// access (read/write)
myarray(index) = value;
// 2D, 3D, 4D arrays:
myarray(x,y) = value;


That's pretty much all about it.


bigsofty

Ok, that looks quite simple, thank you Gernot.  :)
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)