The correct order of inclusion for both <cstdio> and <stdio.h>?
I need to use system functions, for example. ftello()(defined in stdio.haccordance with the POSIX standard). I also need to use standard C ++ functions, for example. std::sprintf()(defined in cstdio, according to ISO C ++).
AFAIK, including only <cstdio>, does not guarantee the definition of non-standard C ++ material, therefore, I think I should include both. I read a long time ago that (for example) with gcc there may be problems with the order in which the file is added.
So, what is the correct inclusion order of both <cstdio>, and <stdio.h>? I am looking for a solution as much as possible for a cross platform (at least for gcc, suncc, intel C ++ / linux and mingw).
OK, after some re-search, I finally came to the conclusion that to include the C ++ header first, and the C header is the right thing. For example, consider the following C ++ 0x header (from gcc):
/ Usr / include / c ++ / 4.3 / tr1_impl / cstdint:
// ...
#define __STDC_LIMIT_MACROS
#define __STDC_CONSTANT_MACROS
#include_next <stdint.h>
// ...
, , C99, C99 stdint.h. , C99 stdint.h , . ++ 0x stdint.h . , c99 stdint.h, cstdint, ++ 0x - stdint.h. , , . stdint.h - ( glibc ), C99 ++ 0x ( , ) gcc. ( , ++), ++ 0x , .