當前位置:成語大全網 - 英語詞典 - c語言的疑問GooInfo[N]什麽意思

c語言的疑問GooInfo[N]什麽意思

struct Goods //商品

{

char Gname[20]; //商品名

char Gno[20]; //商品號

float Bid; //進價

int Quantityin; //進貨量

float Price; //售價

int Quantityout; //銷售量

int Stocks; //庫存量

} 這個是個結構體類型, 末尾的GooInfo[N]; 是指定義了壹個 struct Goods //商品

{

char Gname[20]; //商品名

char Gno[20]; //商品號

float Bid; //進價

int Quantityin; //進貨量

float Price; //售價

int Quantityout; //銷售量

int Stocks; //庫存量

} 類型的N個元素的數組。

其實就是定義了壹個結構體類型的數組。

就好比妳定義壹個整型數組壹樣: int a[10];

只不過結構體類型寫起來比較龐大沒int這麽簡單罷了。

希望對妳有幫助。