OK, I was playing around with Visual Basic and found a function called VarPtr, which returns the address of a variable (as far as I understand it). So I thought I could use this to determine the length of variables like the following code. My question is, could this method of determination ever fail, could these variables ever not be right next to each other in system memory? For example, for a 16-bit integer, if I declare a and b, would a's address ever be any more than 2 from b's address? Perhaps a more specific question is, could another program have its time slice between the declaration of two variables in my program? If a was in system memory and b was in the paging file, would the addresses vary significantly, or is paging implemented so low level as for this not to occur? Does memory ever get rearranged (thus causing a change in address)?