There is no <iostream.h>
header. The standard library header for I/O is <iostream>
. None of the C++ standard library headers end with .h
.
The headers that do exist that end with .h
are from the C standard library. So, for example, <stdlib.h>
is a C standard library header. The C++ standard does make these headers available, but it also provides its own alternatives with almost identical contents. Simply remove the .h
and add a c
to the beginning. So the C++ version of <stdlib.h>
is <cstdlib>
.
Whether you actually need the contents of either <stdlib.h>
or <cstdlib>
is a different matter. Most of the functionality has improved C++ counterparts in C++-specific headers. For example, these C headers provide malloc
, but you should instead be using new
-expressions in C++.
Also note that returning 1
from main
is typically a sign of failure. To indicate a successful execution, do return 0;
instead.