πŸ“Š C++
Q. Which of the following is the correct way to define a function outside a class in C++?
  • (A) void MyClass::myFunction() { }
  • (B) void myFunction() { }
  • (C) MyClass::void myFunction() { }
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (A) void MyClass::myFunction() { }

Explanation: The correct way to define a function outside a class is 'void MyClass::myFunction() { }'.

Explanation by: Ranjeet
The correct way to define a function outside a class is 'void MyClass::myFunction() { }'.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
102
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Ranjeet
Publisher
πŸ“ˆ
83%
Success Rate