+ 5
Why Compiler error ?
2 ответов
+ 5
Because `print` function is not a member of `class A`.
Nonmember functions are defined in global namespace , outside scope of class. You can access them by using scope resolution (::)
You can modify line 15 as
::print(s); //using scope resolution operator to access function from global namespace
Everything will work fine :)
+ 6
🇮🇳Omkar🕉 //Busy , Exams.
Thank you for your answer 🙆🏻♀️