One of the lesser-known features of Visual Studio’s C/C++ compiler are the pointer type attributes __ptr32 and __ptr64. More information about them can be found on MSDN. These pointer type attributes are used to control the visible size and behavior of pointers in 32- and 64-bit applications. Their usage is a bit strange, but if you need to do interop between 32- and 64-bit mode, they can be handy features to have. Additionally, there are the __sptr and __uptr qualifiers which allow you to specify how the pointer types are extended. __sptr denotes sign extension, and __uptr denotes zero extension. Information about these qualifiers can also be found on MSDN.
Continue reading
Who
Aaron Ballman is a senior software engineer for a leading colorimetric software company. He has over a decade of experience writing cross-platform frameworks in C/C++, compiler & language design, and software engineering best practices.
In case you can't figure it out easily enough, the views expressed here are my personal views and not the views of my employer, my past employers, my future employers or some random person on the street. Please yell only at me if you disagree with what you read.
Search
