user3671292
user3671292

Reputation: 83

c++ Libraries for windows only

here is a list with c++ headers.
I would like to know if they can be used to compile programs only for windows or for other systems too:

iostream or iostream.h
stdio.h
cstdlib
math.h

Upvotes: 1

Views: 476

Answers (3)

drk3931
drk3931

Reputation: 91

Almost all those library headers may be used to compile for any operating system, they are maintained by ISO C++, a standardization committee.

https://isocpp.org/faq

Note however the exception is iostream.h. It won't compile for most modern compilers as it is part of a pre standard (the standard being what is defined by the ISO committee).

Just use

#include <iostream> 

instead.

Upvotes: 4

typ1232
typ1232

Reputation: 5607

The files you listed are not libraries, but header files.

They are part of the standard C++ (for iostream) and C (for math.h stdio.h) libraries. Every compiler that is conformant to those standards has to have these headers for you to use.

To clarify: You cannot copy those files from your compiler on Windows and use them on another platform, but your program is free to use them, because the compiler has to provide them.

Upvotes: 0

πάντα ῥεῖ
πάντα ῥεῖ

Reputation: 1

You can compile standard C++ compliant code for almost any system, no matter of windows, linux, iOs, etc.

iostream or iostream.h

iostream.h is not a standard library header. It was used by ancient compilers (e.g. Turbo C++), before any c++ standard was established. These were only available for old windows/DOS systems IIRC.

stdio.h math.h

These refer to the c library, and can be used in standard c++

cstdlib

This is the c++ wrapper for the corresponding c library header stdlib.h available in the current standard.

Upvotes: 3

Related Questions