+ 5
Why Compiler error ?
2 Answers
+ 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 šš»āāļø