I have seen instances of __declspec in the code that I am reading. What is it? And when would I need to use this construct?
__declspec
It is mostly used for importing symbols from / exporting symbols to a shared library (DLL). Both Visual C++ and GCC compilers support __declspec(dllimport) and __declspec(dllexport). Other uses (some Microsoft-only) are documented in the MSDN.
__declspec(dllimport)
__declspec(dllexport)