10th Nov 2019, 11:18 AM
Rama Rehawi
Rama Rehawi - avatar
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 :)
10th Nov 2019, 11:43 AM
šŸ‡®šŸ‡³OmkaršŸ•‰
šŸ‡®šŸ‡³OmkaršŸ•‰ - avatar
+ 6
šŸ‡®šŸ‡³OmkaršŸ•‰ //Busy , Exams. Thank you for your answer šŸ™†šŸ»ā€ā™€ļø
10th Nov 2019, 12:26 PM
Rama Rehawi
Rama Rehawi - avatar