From: "Kim Seng" Newsgroups: comp.os.msdos.djgpp Subject: Re: Help in my codes. Date: Fri, 20 Sep 2002 08:47:04 +0800 Organization: Singapore Telecommunications Ltd Lines: 45 Message-ID: References: <3voboug43iagagl91bk5o4buuu2is8fava AT 4ax DOT com> NNTP-Posting-Host: 203.125.49.168 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com "Hans-Bernhard Broeker" wrote in message news:amck32$1ph$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE... > Kim Seng wrote: > > > Any example on this "std::" coding? > > Before ANSI/ISO C++ Standard, all things in the standard library were > accessible just by their name, i.e. to access the standard output > stream you would write: > > #include > > //... > cout << "blabla" << nl; > > The Standard moved them all into a namespace called "std", so the > actual name of cout is now std::cout. It also changed the names of > the standardized header files to not have a ".h" at the end: > > #include > > //... > std::cout << "blabla" << nl; > > "using namespace std;" tells the compiler that you want all things in > the namespace "std" to become available in your program's space, > without those std:: prefixes. > > The idea behind namespaces is to avoid conflicts of like-named things > from indepentant sources (the language standard, some vendor's > library, a third-party library, your own source code, ...). Like the > one between the function "count" provided by the C++ Standard Template > Library (STL for short) and your original example's variables called > "count", too. Because of namespaces, you can keep calling your > program's own variable "count", but still access the STL function as > std::count. Thanks a lot for the information. I had really learned alot from this newsgroup. As a newbie, I really think that C++ is one of teh best language that I ever learned. It's really a pity that I did not start it early. :p Thanks to Hans for the advise. Thanks. I will continue to learn more this language.