473,396 Members | 2,011 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

VC++ namespace

Jon
Hi

Am I right in assuming that a managed C++ namespace definition can't include the period, unlike C#?

e.g. namespace myApp.Diagnostics -> causes syntax error

whereas the above compiles ok in C#

Thanks

Jon
Nov 17 '05 #1
2 1687
Hi Jon,
Hi

Am I right in assuming that a managed C++ namespace definition can't include the period, unlike C#?
e.g. namespace myApp.Diagnostics -> causes syntax error

whereas the above compiles ok in C#


Yes, you're right. In C++, you'd need to say:
namespace myApp {
namespace Diagnostics {
....
}
}

That is, nesting namespaces to get the same effect.
Besides, in any case, the period is not the scope separator in C++ (it is in
C#, though); in C++ you'd use the double colon :: ;)
--
Tomas Restrepo
to****@mvps.org
Nov 17 '05 #2
Jon
Thanks

"Tomas Restrepo (MVP)" wrote:
Hi Jon,
Hi

Am I right in assuming that a managed C++ namespace definition can't

include the period, unlike C#?

e.g. namespace myApp.Diagnostics -> causes syntax error

whereas the above compiles ok in C#


Yes, you're right. In C++, you'd need to say:
namespace myApp {
namespace Diagnostics {
....
}
}

That is, nesting namespaces to get the same effect.
Besides, in any case, the period is not the scope separator in C++ (it is in
C#, though); in C++ you'd use the double colon :: ;)
--
Tomas Restrepo
to****@mvps.org

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: PDQBach | last post by:
Hello, im a visual c++ und borland c++builder newbie. i have witten a simple mandelbrot algorithm and compiled it with both vc++ (mfc) and cbuilder (vcl) (same code besides the drawing part)....
6
by: SHC | last post by:
Hi all, I created an application from the Console Application (.NET) of VC++ .NET 2003, and I did "Build" the application of the attached .cpp file, volcanoes.xml and geology.dtd on my VC++ .NET...
1
by: John Madsen | last post by:
This bug is easier to just show than to explain I think... namespace M { template <class T> struct A { void f(int a = T::foo()) { } // line 5 }; } namespace N { struct B {
0
by: Leonid | last post by:
Hello, Please help me to resolve next problem: I have Web service installed on the network and I can communicate with it via WSDL file from several applications including VC++6 application...
9
by: borhan | last post by:
Hi folks, I am using vs.net 2003 for a time, however since last week I was using MFC. Now, I am into managed C++ and windows forms. I can say that I am very much confused with it, and I have...
10
by: msnews.microsoft.com | last post by:
Hi, How do I add a reference in VC++.NET? In VB.NET and VC#.NET, there's an option in "Project" menu called "Add Reference". This will add a .NET DLL reference to the current project. After I...
6
by: Ben Terry | last post by:
Hello, I have a VS 2003.NET solution which consists of four c++ unmanaged legacy projects. I am adding a new project to the solution which will be in c#. What do I need to do to my c++ projects...
12
by: Maansi Sanghi | last post by:
Hi, Is there a way to use the System.Xml.Schema classes in VC++ 6.0? Regards, Maansi
9
by: Daniel | last post by:
Hi, While I compile my old C++ source in VC.Net, rebulild whole project, there are always some header files are unvaliable like "fstream.h", "Dxguide.h".....etc. Did VC.Net remove the VC++'s...
0
by: kaypohsingaporean | last post by:
Hi all, I am porting VC++6 code to VC++8/2005. Here's the original code: (I have replaced the greater than sign with &gt; because this forum's parser doesn't like it) template < class CharT,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.