Gentoo Archives: gentoo-dev

From: Terje Kvernes <terjekv@××××××××.no>
To: gentoo-dev@g.o
Subject: Re: [gentoo-dev] Need some c++ help here please:
Date: Mon, 26 Aug 2002 12:13:04
Message-Id: wxxwuqdtug7.fsf@nommo.uio.no
In Reply to: Re: [gentoo-dev] Need some c++ help here please: by Spider
1 Spider <spider@g.o> writes:
2
3 > Richard Reich <rreich@×××××××.com> wrote:
4 >
5 > > #include <iostream>
6 > > using namespace std;
7 > > int main(){
8 > > cout << "Hello World" << endl;
9 > > return(0);
10 > > }
11 >
12 > according to the ml posts I've read this is bad practice and one
13 > should use std::cout whenever/wherever there is need of it. I'm
14 > good at bad practice though ;)
15
16 the point is mostly to avoid cluttering the global namespace with
17 identifiers. you can move the "using namespace <foo>" into a
18 containing block if need be:
19
20 #include <iostream>
21 int main(){
22 using namespace std;
23 cout << "Hello World" << endl;
24 return(0);
25 }
26
27 --
28 Terje

Replies

Subject Author
Re: [gentoo-dev] Need some c++ help here please: "Thomas M. Beaudry" <k8la@×××××××××.com>