Computer Science, asked by Jaykumar6688, 1 year ago

Can we use same member function name for a member function of a class and an outside function in the same program file? if yes, how are they distinguished? if no, give reasons.

Answers

Answered by Anonymous
0
Which menu option can be used to split windows into two? ( 1 m )?
Answered by abhishekbharti9910
0

Answer:

yes , several different classes can use same function name.

Explanation:

the membership label of the class function will resolve there scope.

example ;

>> void class1 : : sum(int a, int b);

>>void class2 : : sum(int a, int b, int c);

here is same function name ;> sum but used by different classes

----> this is resolved by compiler by using scope resolution operator " : : ",

    check member function association with class.

Similar questions