cmath vs math.h (And similar c-prefixed vs .h extension headers)

前端 未结 4 689
一整个雨季
一整个雨季 2020-12-08 00:04

I\'ve seen some information about differences between things like iostream vs iostream.h. From what I gathered from those the difference between th

4条回答
  •  盖世英雄少女心
    2020-12-08 00:41

    The headers whose names start with c are derived from the headers of the C standard library. The corresponding headers with the c prefix removed and a .h suffix added are identical (or very nearly identical) to the C standard library headers.

    defines the relevant symbols under the std namespace; defines them globally.

    (I just learned it's not quite that simple; see Alf's answer.)

提交回复
热议问题