Aug 14, 2010 at 6:18am UTC
I always see people saying that it isn't safe to use windows.h header file. Why is this? Is it dangerous?
Aug 14, 2010 at 6:31am UTC
the only thing I can think of as to a reason why is:
1) it destroys portability (windows.h only works on Windows, obviously)
2) it #defines a bunch of stuff like min/max that interferes with the standard library
#1 probably isn't a concern if you're looking to program for Windows.
#2 is easily worked around.
Aug 14, 2010 at 6:34am UTC
What kind of stuff does it #define? I'm not asking for exact examples, that sounds like it would take forever. Just the big stuff.
Thanks you very much. :)
Aug 14, 2010 at 7:30am UTC
min and max are the only things I can think of offhand that immediatly conflict with the standard libs.
It defines tons of other stuff that pollutes the namespace, but it's all easily avoided.