A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
Visual Studio automatically include the stdlib.h for
rand function.
How can I disable the auto include header file in
visual studio?
You can't. (Unless you want to risk seriously breaking
the compiler's libraries, headers, etc.)
Tampering with the compiler's headers is a serious
transgression that threatens to destabilize the entire
chain of dependencies. It is a cardinal rule that you
should never tamper with the headers or libraries that
ship with the compiler. In addition to possibly breaking
some aspect of its current implementation, there is the
risk if sabotaging future patches, updates, etc.
The compiler may auto-include stdlib.h via an embedded
include in the iostream header, or in one of the other
headers which it pulls in. When it does it's because the
implementor(s) felt it was necessary for some aspect of
the implementation.
This may change from version to version. Therefore it
is strongly advised that such implicit including
not be relied upon. Rather one should always explicitly
use the #include associated with a given function, etc.
Even when it is already auto-included via another header.
- Wayne