|
INTERVIEW QUESTIONS
PROGRAMMING LANGUAGES
C++
DETAILS
Question: How can a '::' operator be used as unary operator?
Answer: The scope operator can be used to refer to members of the global namespace. Because the global namespace doesn’t have a name, the notation :: member-name refers to a member of the global namespace. This can be useful for referring to members of global namespace whose names have been hidden by names declared in nested local scope. Unless we specify to the compiler in which namespace to search for a declaration, the compiler simple searches the current scope, and any scopes in which the current scope is nested, to find the declaration for the name.
|
|
|
Category |
C++ Interview Questions & Answers -
Exam Mode /
Learning Mode
|
Rating |
(0.3) By 6903 users |
Added on |
7/16/2015 |
Views |
71643 |
Rate it! |
|
|
Question:
How can a '::' operator be used as unary operator?
Answer:
The scope operator can be used to refer to members of the global namespace. Because the global namespace doesn’t have a name, the notation :: member-name refers to a member of the global namespace. This can be useful for referring to members of global namespace whose names have been hidden by names declared in nested local scope. Unless we specify to the compiler in which namespace to search for a declaration, the compiler simple searches the current scope, and any scopes in which the current scope is nested, to find the declaration for the name. Source: CoolInterview.com
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|
|
Related Questions |
View Answer |
|
What are the main underlying concepts of object orientation?
|
View Answer
|
|
What do u meant by "SBI" of an object?
|
- C++ Interview Questions & Answers">
View Answer
|
|
Differentiate persistent & non-persistent objects?
|
View Answer
|
|
What do you meant by active and passive objects
|
View Answer
|
|
What is meant by software development method?
|
View Answer
|
|
Why does the function arguments are called as "signatures"?
|
View Answer
|
|
What is Memory alignment??
|
View Answer
|
|
When are temporary variables created by C++ compiler?
|
View Answer
|
|
When do use "const" reference arguments in function?
|
- C++ Interview Questions & Answers">
View Answer
|
|
What are storage qualifiers in C++ ?
|
View Answer
|
|
What are C++ storage classes?
|
View Answer
|
|
What is conversion constructor?
|
View Answer
|
|
What are all the implicit member functions of the class? Or what are all the functions which compiler implements for us if we don't define one.??
|
View Answer
|
|
When are copy constructors called?
|
View Answer
|
|
What is a Makefile?
|
View Answer
|
|
What does extern mean in a function declaration?
|
View Answer
|
|
Will it execute or not?
C++ Interview Questions and Answers
(Continued from previous question...)
Will it execute or not?
void main() { char *cptr = 0?2000; long *lptr = 0?2000; cptr++; lptr++; printf(” %x %x”, cptr, lptr); }Will it execute or not?
|
View Answer
|
|
How can you quickly find the number of elements stored in a a) static array b) dynamic array ? Why is it difficult to store linked list in an array? How can you find the nodes with repetetive data in a linked list?
|
View Answer
|
|
What is the difference between Mutex and Binary semaphore?
|
View Answer
|
|
What methods can be overridden in Java?
|
View Answer
|