answersLogoWhite

0

Name clashes occur whenever you re-use the same name within the same scope. For instance, if you declare a variable with the name v, you cannot declare another variable v while the previous instance remains in scope. You can, however, nest one scope within another and re-use the same name. In this case, the original name is shadowed: it remains in scope but is not accessible within the nested scope. When the nested scope falls from scope, the original name becomes visible again.

Name clashes often occur when you use directives such as using namespace std; at namespace scope and particularly in header files, where common names (such as list or vector) can easily clash with namespace entities (such as std::list or std::vector). Directives such as these should be used sparingly and appropriately, ideally scoped to the functions and classes that actually use them in order to minimise unnecessary coupling.

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

What is the name of the structure type in C plus plus?

The same as in C, struct.


What is extension part of c plus plus?

C++ Extension Name is... Syntax is: File Name.extension name. Ex: ankit.cpp


What year c plus plus was developed?

Developed in 1979 by the name of C with classes. Renamed to C++ in 1983.


What is default name of c plus plus?

If you mean the original name of C++, it was originally called "C with Classes". However, after the introduction of template metaprogramming, it was renamed C++ which meant "the successor to C".


What is C plus H plus Cl2 plus N plus H plus Cl?

I would tell, no reaction will occur the way the question has been asked.


What was c plus plus previously called?

'C with Classes' began development in 1979. The name changed to 'C++' in 1983.


Who thought up the name c plus plus?

Rick Mascitti.


Is the word main an illegal variable name in C PLUS PLUS?

I can tell you that it is not an illegal variable name in C. I do not currently have a C++ compiler installed, but I would assume that it would also be valid in C++.


Is microsoft visual c plus plus the same as visual c plus plus?

Yes. Microsoft Visual C++ is the correct name, but it is often abbreviated to MSVC++ or just VC++. They are all the same.


Defference between c plus plus and c?

these are difference in between c and c++: a) C is a SPL and C++ is a OOP. b) C has not concept of object but C++ has this feature. c) C has not 'class' name data type but C++ has.


Main meaning of turbo c plus plus?

Name of a compiler (and IDE) from Borland.


How do you include userdefined headerfiles in c plus plus program?

#include "what-its-name-is.h"