Archived

This topic is now archived and is closed to further replies.

zorlack

void *?

Recommended Posts

Guest Anonymous Poster
depends what the dynamic struct is. If it is just references you could try

void **DynamicListToStructures;  


then you set up your dynamic list by something like:

DynamicListToStructures = new void *[HowManyStructures];
for (int i = 0; i < HowManyStructures; ++i)
{
DynamicListToStructures[ i] = (void*)MyStruct;
}


Of course... you don't want to fill up that array with a single structure like in that for loop. So use the above at your own discression...

[edit by dwarfsoft]fixed your [ i] tag so that it didn't display in italics[/edit]

[edited by - dwarfsoft on July 28, 2003 11:34:16 PM]

Share this post


Link to post
Share on other sites
what i mean is that instead of declare

struct variable
{
char name[20];
int numbre;
};

on the code page, i tell the program what i want. in other words to work like access when you are creating a table.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
void ***MyAccessTable;

MyAccessTable = new void ** [NumberOfRows];
for (int i = 0; i < NumberOfRows; ++i)
MyAccessTable[ i] = new void *[NumberOfColumns];

struct s_myStruct1
{
char name[40];
int age;
} myStruct1;

struct s_myStruct2
{
char cd_title[110];
char artist[100];
} myStruct2;

MyAccessTable[4][1] = (void*)&myStruct2;
MyAccessTable[12][3] = (void*)&myStruct1;


That enough free code for you?

Share this post


Link to post
Share on other sites