C++ is a more stringent type checking language than C Thus, you need to output it manually, but in C it is automatically created automatically.
Here, calloc returns void* and b is of type int(*)[] , so typing is mandatory.
Other types of castes are also available in C ++, you need to keep in mind
<static_cast> <const_cast> <reinterpret_cast> <dynamic_cast>
See this for more details. When should static_cast, dynamic_cast, const_cast, and reinterpret_cast be used?
source share