動態矢量我有一個預定義的結構使用方法:創建預定義的結構
typedef struct somestruct_s {
int s;
union {
unsigned char *ptr;
unsigned char l_ptr[sizeof(char *)];
};
}somestruct_t, *somestruct;
它包含聯盟,以減少內存使用情況。 我知道大小可能因m32和m64編譯(指針大小)而異。 我的問題是如何「使用」我的精確分配結構。這個結構的目的是實現基本的位操作,s變量包含位圖的大小(以字節爲單位)。如果位圖可以放入指向位圖的內存中,那麼我們在那裏分配它。我寫了一些位圖操作,但我不能真正得到結構或如何操作它。
可能重複使用結構的聯盟](http://stackoverflow.com/questions/15660737/extendable-map-vector-using-structure-of-union) – 2013-03-27 14:43:03