I want to use “Dev-C++” for compile c++ codes.
So I download and install it, and write this code:
#include <iostream.h>
main () {
cout << "124";
}
but when I compiled it, it said:
In file included from
E:/Dev-Cpp/include/c++/3.4.2/backward/iostream.h:31,
from [myfile path]\Untitled1.cpp:1:
E:/Dev-Cpp/include/c++/3.4.2/backward/backward_warning.h:32:2:
warning: #warning This file includes
at least one deprecated or antiquated
header. Please consider using one of
the 32 headers found in section
17.4.1.2 of the C++ standard. Examples include substituting the header
for the header for C++ includes,
or instead of the
deprecated header . To
disable this warning use
-Wno-deprecated.
After I saw errors, I change my code to this code:
#include <iostream>
main () {
cout << "124";
}
but it said again that errors.
I compile first code easily in Turbo C++, BUT in Dev-C++ …
What can I do?
First, make sure you write out the full definition of
main, including theintreturn type. Leaving out the return type is an old, antiquated practice which doesn’t fly these days.Second, in the new-style headers—the ones missing the
.hextension—the standard library is under thestdnamespace. There are two ways to make your program work:1. Add an
std::qualifier tocout.2. Add a
usingdeclaration to allow unqualified references to thestdnamespace.