Why does rand() compile without including cstdlib or using namespace std?

Viewed 3543

According to the book I'm reading, rand() requires #include <cstdlib> in C++
However, I am able to compile the following code that uses rand() without #include <cstdlib> nor using namespace std; in Visual Studio 2015.
Why are these two not needed to compile? Should I include cstdlib?

C++ Code:

#include <iostream>

int main()
{
    std::cout << rand() << std::endl;
}
3 Answers
Related