![]() |
|
|||||||
|
|
Thread Tools | Search this Thread | Rate Thread |
|
#1
|
|||
|
|||
Multiple instances of operator of scope in namespace using statementHi guys - just a quick one (I think!) -
I am new to C++ programming, but have done some programming in Fortran, C and VBA. I am currently undertaking a particle physics PhD at Cambridge University in the UK and have been given a large and complex LHC/CERN program to understand. I am unclear on the following code section: CPP / C++ / C Code:
Does this code line simply mean that I can use variables defined in all namespaces i.e Rich, Rec and MC without constantly using the operator of scope :: (e.g. Rich::a or Rec::a) ??? Isn't this programming style open to complications? e.g. if there is a variable called "a" in the Rich and Rec namespaces then the compiler will not know which "a" I am referring to! Thanks, Sam |
|||
|
#2
|
|||
|
|||
Re: Multiple instances of operator of scope in namespace using statementQuote:
CPP / C++ / C Code:
Output: Code:
Now, uncomment the i2 or i3 print statements and try to compile. Regards, Dave |
|
#3
|
|||
|
|||
Re: Multiple instances of operator of scope in namespace using statementI will have a look at that in the morning - thanks Dave-
Sam |
|
#4
|
|||
|
|||
Re: Multiple instances of operator of scope in namespace using statementSuper - cheers Dave
Sam |
Recent GIDBlog
Problems with the Navy (Officers) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Multiple instances of a PropertySheet, one won't close until other is closed | ct991 | MS Visual C++ / MFC Forum | 0 | 17-Jan-2008 15:43 |
| Major newbie problem | cynack | MS Visual C++ / MFC Forum | 1 | 08-Apr-2007 11:25 |
| Loading multiple instances of a DLL for different threads. Is it possible? | philipina | C Programming Language | 4 | 19-Feb-2007 00:11 |
| preventing multiple instances of an application | sharada | C Programming Language | 8 | 28-Nov-2006 14:11 |
| Which Header Files to Use?? | BobbyMurcerFan | C++ Forum | 8 | 16-Jun-2004 18:29 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The