O'Reilly logo

Microsoft® Visual Basic® 2010 Developer’s Handbook by Klaus Löffelmann and Sarika Calla Purohit

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Targeted Memory Assignment for Structure Members with the Attributes StructLayout and FieldOffset

Structures permit a targeted placement of memory areas for field variables. It’s important to mark the structure with a special attribute and thus instruct the compiler how to overlap the memory areas of the various field variables.

This possibility makes working with the different byte significance of integer values very easy. Integer numbers are composed of bytes, as you know. A number of the data type Short is stored in 2 bytes, an Integer in 4 bytes, and a Long in 8 bytes. For signed integer values, the highest bit is used as the sign. If that bit is set, the value is negative; otherwise, it is positive. It is relatively labor-intensive to extract ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required