Quantcast
Channel: The Old New Thing
Viewing all articles
Browse latest Browse all 24428

re: Understanding the classical model for linking, groundwork: The algorithm

$
0
0

Ok - according to the MSDN documentation:

"A global data item can normally be initialized only once in an EXE or DLL project. selectany can be used in initializing global data defined by headers, when the same header appears in more than one source file. selectany is available in both the C and C++ compilers."

So basically it's so you can do "int MyExternVar = 0;" in a header and not get the linker to explode with errors telling you that every C file is defining overlapping "MyExternVar"s.


Viewing all articles
Browse latest Browse all 24428

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>