C and C++ Programming
C++ Tips - Namespaces | C++ Tips - Namespaces |
|
|
|
Coming from C world you might use the following code: #include <iostream.h> In file included from /usr/include/c++/4.2/backward/iostream.h:31, from test.cc:1: /usr/include/c++/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 <X> header for the <X.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated. To remove warning and write a proper C++ code you must use one of the following: a) Variant 1 #include <iostream> #include <iostream>
#include <iostream> Best use is Variant 1, you use the namespace twice. If you use functions more often, Variant 2 is ok. Variant 3 is used if you many names from different namespaces. Still if you use Variant 3, do not use it globaly, but place it at the beggining of every function. |
| < Prev |
|---|

