=>#include <stdio.h>
=>
=>struct teststruct {
=> int i;
=> char c;
=>};
=>
=>int main(int argc, char** argv) {
=> printf(" Size of int is %d, Size of char is %d and size of struct is %d\n",
=> sizeof(int),sizeof(char),sizeof(struct teststruct));
=>
=>}
=>
=>
=>
=>I am getting 4,1,8 for that one. Maybe I have forgotten adding numbers,
=>but isn't 4+1=8 anymore??
=>
Are you aware of something called padding ?
Just try putting a
#pragma pack(1) on top of the c program and rerun it.
Suman
--
Codito, ergo sum - "I code, therefore I am"
Suman Saraf, http://members.xoom.com/ssaraf
--
-----------------------------------------------------
An alpha version of a web based tool to manage your
subscriptions with this majordomo2 server is available
at http://lists.linux-india.org/cgi-bin/mj_wwwusr