Which of the following is correct syntax for declaring namespace?

Options
- namespace identifier { Entities }
- class namespace identifier { Entities }
- namespace { Entities }
- namespace identifier ( Entities )


CORRECT ANSWER : namespace identifier { Entities }

Discussion Board
more than 1 answer

In C++ there is such thing like anonymous namespace that is used for incapsulation so any code that is within this namespace is available in the current file:

//somefile.cpp

namespace
{
const std::vector_<_tableData_>_Table = initializeData(); /* I'm soory about that underscores. careerride server is nervous about that string of code.. xD */
}

EduardK 08-11-2015 10:27 AM

Write your comments


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)


Advertisement