|
From: Daniel G. <sp...@ho...> - 2002-03-21 18:13:27
|
<html><div style='background-color:'><DIV></DIV>
<DIV>
<P>Could someone explain this to me a little bit clearer? Is it just saying you need to write the namespace declaration to write headers without the .h extention? If so what's the point in that?</P>
<P>Thanks,</P>
<P>Daniel</P>
<P> </P>
<P>C++ also supports namespaces. Namespaces simplify the writing of programs that combine libraries from various members. The namespace feature is not available in C. The statement that must be included in the program when using namespaces is<FONT color=#ff0000> using namespace std</FONT>;.</P>
<P>e.g.</P><FONT color=#ff0000>
<P>// This is a program to demonstrate the use of namespace.</P></FONT><FONT color=#0000ff>
<P>#include <iostream></P>
<P>using namespace std;</P></FONT><FONT color=#ff0000>
<P>void main()</P>
<P>{</P>
<P>cout << "Using Namespace";</P>
<P>}</P></FONT>
<P>In C++, if you use iostream instead of iostream.h, the namespace directive is used to make the definitions in iostream available to your program.</P></DIV></div><br clear=all><hr>MSN Photos is the easiest way to share and print your photos: <a href='http://g.msn.com/1HM305301/14'>Click Here</a><br></html>
|