+ 1
Can anybody tell me the actual use of over riding in C++
2 Answers
+ 1
Suppose you have to find the area of a rectangle and a circle and you are asked to create a function named area. Here you have two choices one is two make two separate function with different names and second is to override. Here it may seem that either doesnt make much difference but think of an organisation working on thousands of line of code.Naming the functions doing the same task(calculating area here) different will make the whole code a mess and debugging will be very painful. Hence to overcome this we name both the function the same and make changes in the implemetation part. this make the code look clean and understandable
+ 1
thanks buddy