Forums Programming Assignment Help What is function overloading and operator overloading

This topic contains 1 reply, has 2 voices, and was last updated by  Tyler 6 years, 8 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #15400

    ahwriter
    Participant

    What is function overloading and operator overloading?

    #15408

    Tyler
    Participant

    Answer: Function overloading: The capability with which C++ enables several functions of the same name to be defined, as long as these functions have different sets of parameters is called function overloading. The C++ compiler selects the proper function by examining the types, number and order of the arguments in the cal when the overloaded function is called. This is used for creating several functions of the same name that perform similar tasks but on different data types.

    Operator overloading: It allows the developer to program using notation closer to the target domain and also allow the existing C++ operators to be redefined to work on objects of user-defined classes. Overloaded operators are syntactic sugar for equivalent function calls. It is generally defined by the language, the programmer, or both.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.