I have two structures
struct SimpleXY
{
double x;
double y;
};
struct SimpleXyLink
{
int num_xy;
SimpleXY *simpleXyList
If it is C++ (I'm confused here because you use free :-))
struct SimpleXY
{
double x;
double y;
};
struct SimpleXyLink
{
SimpleXyLink() : simpleXyList( new SimpleXY ) { }
~SimpleXyLink() { delete simpleXyList; }
int num_xy;
SimpleXY *simpleXyList;
};
int main()
{
SimpleXyLink* pXYLink = new SimpleXyLink();
delete pXYLink;
}