如何建立元素是struct数组的数组?高手帮忙!我建立了一个struct
typedef struct tagGridItem{
CString value;
int nRow;
int nCol;
} GridItem;然后定义了一个struct数组:
CArray<GridItem, GridItem> m_ItemList;我想在建立一个数组,通俗点讲,这个数组里有三个元素,每个元素是一个struct数组,并需要每个struct数组的size不一样?我该怎么做呀?高手帮帮我呀?
typedef struct tagGridItem{
CString value;
int nRow;
int nCol;
} GridItem;然后定义了一个struct数组:
CArray<GridItem, GridItem> m_ItemList;我想在建立一个数组,通俗点讲,这个数组里有三个元素,每个元素是一个struct数组,并需要每个struct数组的size不一样?我该怎么做呀?高手帮帮我呀?
size = 你 要 得 大 小
GridItem m_ItemList = new GridItem[size]
int size ;
size = 你 要 得 大 小
GridItem *m_ItemList = new GridItem[size]
CString value;
int nRow;
int nCol;
} GridItem;typeddef CArray<GridItem, GridItem> ItemList;
CArray<ItemList*,ItemList*> m_myArray;for(int i=0;i<3;i++)
{
ItemList* itemlLS = new ItemList;
m_myArray[i] = itemlLS;
}
int a,
int b
};aa * xx[];这样每个xx[0] , xx[1]......都是一个struct aa *结构的变量了,在用这个指针完成你要的结构数据成员的内存分配等等功能.该给点分吧,哈哈。