> why the sizeof sturcture is alway greater than the collective sizes of all > the elements in it. > > eg > struct node { > int a; > char c; > int b; > }; It is not, in general, possible to (portably) estimate the size of a structure just by looking at its fields, as the compiler is free to add padding if that allows better code. In particular, most systems can only efficiently access memory locations if the address of the location is a multiple of its size (i.e. if its naturally aligned). This means that if the structure is to be stored in an array, its size must be a multiple of the size of the largest single member, so that every element has proper alignment. In this case, the largest member is an int, and so the whole structure's size must be a multiple of four. Steven Smith, sos22@cam.ac.uk.