I am trying to implement a linked list of objects of type SiteStructure:
struct SiteStructure
{
int numOfSect;
double easting;
double northing;
CString siteCodeStr;
CString prdPath[6];
CString prdNames[6];
double eIRP[6];
int angle[6];
SiteStructure * nextSite;
}
I use a function to create the linked list using the "new" command:
struct SiteStructure* pSStruct = new SiteStructure;
to create each element in the list, but when my function returns and the calling method tries to access the data in the linked list elements I get memory access error. It seems like the elements of the linked list have scope limited to the function that created them. Any suggestions on how to fix the problem, any idea. Thanks, your help is greatly appreciated. [sig][/sig]
struct SiteStructure
{
int numOfSect;
double easting;
double northing;
CString siteCodeStr;
CString prdPath[6];
CString prdNames[6];
double eIRP[6];
int angle[6];
SiteStructure * nextSite;
}
I use a function to create the linked list using the "new" command:
struct SiteStructure* pSStruct = new SiteStructure;
to create each element in the list, but when my function returns and the calling method tries to access the data in the linked list elements I get memory access error. It seems like the elements of the linked list have scope limited to the function that created them. Any suggestions on how to fix the problem, any idea. Thanks, your help is greatly appreciated. [sig][/sig]