Question related to function overloading with respect to constant functions
11 views
Skip to first unread message
Aman Tripathi
unread,
Apr 24, 2023, 3:36:31 AM4/24/23
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Discussion forum for Programming in Modern C++
if there are functions with the same name create overloading error then why this program doesn't throw error and runs smoothly even having the same name at line 8 & 9.
soumen paul
unread,
Apr 26, 2023, 2:40:57 AM4/26/23
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Discussion forum for Programming in Modern C++, Aman Tripathi
Because of the constness. One is declared as constant which can only be called using constant object and another function needs to be called using non-const object.