[問題] 資料結構

看板TransCSI作者 (喬巴)時間17年前 (2008/08/27 01:30), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串4/6 (看更多)
假設一個字元 (character) 佔一個 byte,一個整數 (integer) 佔兩個 byte,在記憶體 中,一個字組 (word) 相當於兩個 bytes,字元可以儲存於任何位址,而整數則必須儲存 於一整個字組中。現在以 C 定義一資料結構如下: struct person { int id; char name[20]; int age; char sex; } student[100]; 若 student[0] 之起始位址為 200 (十進位),請問 student[10].age 之位置為: (a) 472 (b) 473 (c) 482 (d) 483 ans: c 要怎麼計算阿? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 218.173.241.2
文章代碼(AID): #18j3tAeq (TransCSI)
討論串 (同標題文章)
文章代碼(AID): #18j3tAeq (TransCSI)