C++ math functions can be used without including the directive “math.h” in VS 2013

后端 未结 2 2006
傲寒
傲寒 2021-01-19 15:48

I am very curious why I can use the math functions in C++ without including the \"math.h\". I can\'t find an answer with google search.

Here is the simple code I am

相关标签:
2条回答
  • 2021-01-19 16:04

    Any standard header is allowed to include any other standard header.

    0 讨论(0)
  • 2021-01-19 16:09

    if you would compile the same with gcc-4.8 it would complain.

    Keep in mind that this is not something to rely on if you want your code to be portable and compilable on different versions of the same or different compilers.

    0 讨论(0)
提交回复
热议问题