Logo 
Search:

C++ Programming FAQ

Submit Interview FAQ
Home » Interview FAQ » C++ ProgrammingRSS Feeds

Define a namespace called ‘samplespace’, which includes a member variable,namely ‘p’

  Shared By: Shruti Sharma    Date: Dec 15    Category: C++ Programming    Views: 1465

Answer:

Let us define a namespace called ‘samplespace’, which includes a member variable, namely ‘p’. How will you access this member variable from outside the namespace?

I. using namespace samplespace;
II. using samplespace :: p;
III. samplespace.p;
IV. p :: samplespace();

Options

a) I only
b) II only
c) Both III and IV
d) Both I and II

Answer : d) Both I and II

Share: 
 



Your Comment
  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].