This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: how to make it working correct(libstdc++)?
- From: Nathan Myers <ncm-nospam at cantrip dot org>
- To: libstdc++ at gcc dot gnu dot org
- Date: Mon, 12 Aug 2002 11:40:37 +0000
- Subject: Re: how to make it working correct(libstdc++)?
- References: <20020812084840.GA27857@pingu.tti>
On Mon, Aug 12, 2002 at 11:48:40AM +0300, Christoph Bugel wrote:
> You should write it this way:
>
> #include <iostream>
> #include <string>
> using namespace std;
>
> int main()
> {
> string str("hello world!");
> cout<<str<<endl;
> return 0;
> }
It's time to stop recommending "using namespace std;" in user code.
The standard library defines far too many names for people to be
expected to remember them all. The canonical program is better
expressed as:
#include <iostream>
#include <string>
int main()
{
std::string str("hello world!");
std::cout << str << std::endl;
return 0;
}