宣告兩組 struct ,並在_CMAP 宣告包含_CMAP_Comps 的動態宣告**
struct _CMAP_Comps
{
char No;
short CNS_Comp_No;
char laye;
char SpSt;
char PaNo;
short X_max;
short X_min;
short Y_max;
short Y_min;
};
typedef struct _CMAP
{
short Unicode;
short Big5;
short CNS;
int Offset;
short Length;
short X_max;
short X_min;
short Y_max;
short Y_min;
_CMAP_Comps **AA;
} _CMAP;
// 主程式 實現方法 (不完整)
main()
{
_CMAP **CMAP;
CMAP=new _CMAP*[10];
CMAP[0]=new _CMAP;
CMAP[0]->Unicode = StrToInt(data_1);
CMAP[0]->Big5 = StrToInt(data_2);
CMAP[0]->CNS = StrToInt(data_3);
CMAP[0]->X_max = StrToInt(data_4);
CMAP[0]->X_min = StrToInt(data_5);
CMAP[0]->Y_max = StrToInt(data_6);
CMAP[0]->Y_min = StrToInt(data_7);
CMAP[0]->AA=new _CMAP_Comps*[10];
for(int i=0;i<10;i++){
CMAP[0]->AA[i]=new _CMAP_Comps;
}
}
2014年12月23日 星期二
[BCB][C++] struct 動態宣告
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言