Download Special Edition Using Visual C++ 6

Transcript
Special Edition Using Visual C++ 6 -- Ch 26 -- Exceptions and Templates
nickname or short form. Listing 26.21 is a short program that demonstrates namespace aliases.
Listing 26.21 Using a Namespace Alias
namespace ThisIsANamespaceName
{
int i;
int j;
int Func()
{
return 2;
}
}
int main()
{
namespace ns = ThisIsANamespaceName;
ns::i = 0;
ns::j = 0;
int num1 = ns::Func();
return 0;
}
© Copyright, Macmillan Computer Publishing. All rights reserved.
http://www.pbs.mcp.com/ebooks/0789715392/ch26/ch26.htm (23 of 23) [7/29/1999 3:57:14 PM]