Original Post
I'm going through Functions in my coursework now. (Self Study on an older text book, no instructor led class)And running into a personal question that I just can't seem to answer, or maybe I have, and just don't realize it
Function overloading is the idea that functions can have the same name, as long as the parameters are different. So, for example, to draw something, you may have different methods of doing it, each would be it's own function, right?
My question is, how does the code know WHICH function to use? If I want to draw a circle, and there are 2 different ways, each in it's own function, how does the program KNOW that I want to use function A, as opposed to Function B? Is it based on the parameters that are passed?
Function overloading is the idea that functions can have the same name, as long as the parameters are different. So, for example, to draw something, you may have different methods of doing it, each would be it's own function, right?
My question is, how does the code know WHICH function to use? If I want to draw a circle, and there are 2 different ways, each in it's own function, how does the program KNOW that I want to use function A, as opposed to Function B? Is it based on the parameters that are passed?