Q. Which of the following is the correct way to define a namespace in C++?

  • (A) namespace MyNamespace { }
  • (B) namespace { MyNamespace }
  • (C) Both A and B
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (A) namespace MyNamespace { }
Explanation: The correct way to define a namespace is 'namespace MyNamespace { }'.
Explanation by: Vinay
The correct way to define a namespace is 'namespace MyNamespace { }'.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
170
Total Visits
πŸ“½οΈ
2 y ago
Published
πŸŽ–οΈ
Vinay
Publisher
πŸ“ˆ
95%
Success Rate