Re: [Dev-C++] Compiling problems with 4.9.7.0 and GCC 3.2
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: <cg...@wo...> - 2003-01-17 10:51:00
|
Ioannis Vranos wrote:
>-------Original Message-------
>
>=20
>
>From: Carlos Garc=EDa del Monte
>
>Date: Thursday, 16 January 2003 9:01:09 PM
>
>To: Dany P. Wu; dev-cpp-users-list
>
>Subject: Re: [Dev-C++] Compiling problems with 4.9.7.0 and GCC 3.2
>
>=20
>
>#include <iostream>
>
>=20
>
>using namespace std;
>
>=20
>
>int main()
>
>{
>
>whatever;
>
>}
>
>=20
>
>=20
>
>=3D=3D> And this is a nice attempt to defeat the namespace system (which=
is bad)
>
Yeah, namespaces intend, is, as said, have a clear distinction between=20
functions of different vendors, etc which can be named the same way, and=20
your own code can have the same problems, so the recommended (and the=20
best) is avoid this kind of general declaration of a namespace (this=20
phrase is of mine, not from any book) , so the recommended is use=20
namespace_name::variable(orfunction) and simply variable(orfunction) for=20
those you are declaring yourself. Or, if you're lazy, you can use that=20
declaration for individual functions or variables from the namespace you=20
know that there will no other with the same name you want to use, as
using namespace std::cout;
using namespace std::in;
If you don't want use namespaces the rigth way, the best is include the=20
.h versions, which don't declare namespaces, but are considered=20
deprecated and probably (?) they won't be supported in the future, as=20
said in my original answer.
|