hm I have a new issue... with initializing structs in a class :/
instead of using arrays inside structs, I went for a structarray now.
all I want to do is initialize the struct so I can use it in the set function of my class:
Code:
class hashclass
{
private:
int mysize;
struct hashstruct
{
int value;
string teststring;
struct dataset *ptr;
};
public:
hashclass()
{
unsigned int mysize = 500;
struct hashstruct myhash[mysize];
}
~hashclass()
{
}
void set(string name, int value)
{
myhash[value].teststring= name;
}
}
myhash is not declared as its only the constructor of hashclass
so I try to init it in private first:
Code:
class hashclass
{
private:
int mysize;
struct hashstruct *myhash;
struct hashstruct
{
int value;
string teststring;
struct dataset *ptr;
};
public:
hashclass()
{
unsigned int mysize = 500;
myhash = new hashstruct[mysize];
}
~hashclass()
{
}
void set(string name, int value)
{
myhash[value].teststring = name;
...
}
...
}
but this won't work =/ any chance you could point me to the issue? :/
thx in advance