Because of this, it has become my practice to attempt, when I create my PowerBASIC UDTs, to create them in multiples of 8 or 16 bytes. To achieve this I'll often put dummy fillers at the end, just as shown above.
Note that a type such as this will work without problems in both C and PowerBASIC ...
struct MyStruct
{
short int iSp; // 2 bytes
short int iDbh; // 2 bytes
short int iHt; // 2 bytes
short int iCull; // 2 bytes
};
Type Tree
iSp As Integer
iDbh As Integer
iHt As Integer
iCull As Integer
End Type
... because both are 8 bytes in size, which is some sort of memory granulation boundary.
I believe there are some obscure compiler command line switches in C/C++ that can control this, but I've personally never fooled with them.
To be perfectly honest, padding structs or types with extra dummy variables can become useful for when application requirements change and extra variables are needed. Especially when the UDTs are used for templates of file storage into records.