Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Assigning dyanamically allocated CStrings

Status
Not open for further replies.

reneb

Programmer
Aug 8, 2000
43
US
I have dynamically created a structure of type SiteStruecture using calloc.
struct SiteStructure
{
int numOfSect;
double easting;
double northing;
CString siteCodeStr;
CString prdPath[6];
CString prdNames[6];
double eIRP[6];
int angle[6];
SiteStructure * nextSite;
}

when I try to assign values to the siteCodeStr, which is a CString I get an assertion error, something like the CString is null or something. When I try to assing the doubles or ints, I have no problem. And I don't have any problems if I create a SiteStructure on the stack (not dynamically) and try to assign values to it. Does any one have a clue as to what is going on? Please help. Thanks in advance. [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top