Hello !
I have a question to you.
I am unsing a self written List with a DataStructure and I always get an
AccessViloation exception when i would like to add a new Element.
Data Structures:
Code:
struct weinEintrag
{
CString mWeinName;
CString mWeinJahrgang;
CString mWeinPreis;
CString mWeinProduzent;
CString mWeinBewertung;
CString mWeinAlc;
CString mWeinNotiz;
struct weinEintrag *next;
};
struct weinListe
{
struct weinEintrag *start;
};
The following function takes the weinEintrag as Argument and i want to copy
the values of the Argument into a new WeinEintrag structure:
I am using the following code :
Code:
int weinListe_add( struct weinListe *wnLst, struct weinEintrag *wnE)
{
struct weinEintrag *we;
we = (struct weinEintrag *) malloc( sizeof(struct weinEintrag));
if(!we)
return 0;
we->mWeinAlc = wnE->mWeinAlc; //HERE I GET THE ACCESS VIOLATION
!!!!!
we->mWeinBewertung = wnE->mWeinBewertung;
we->mWeinJahrgang = wnE->mWeinJahrgang;
we->mWeinName = wnE->mWeinName;
we->mWeinNotiz = wnE->mWeinNotiz;
we->mWeinPreis = wnE->mWeinPreis;
we->mWeinProduzent = wnE->mWeinProduzent;
we->next = wnLst->start;
wnLst->start = we;
elementCounter++;
return 1;
}
Can you tell me what's wrong in this code ??
regards, martin