Total Page Preview:   000000000236

What is operator overloading?

Operator overloading is a function where different operators are applied and depends on the arguments. Operator,-,* can be used to pass through the function , and it has their own precedence to execute.

 

Example:

class complex {

double real, imag;


public:

complex(double r, double i) :

real(r), imag(i) {}

complex operator+(complex a, complex b);

complex operator*(complex a, complex b);

complex& operator=(complex a, complex b);

}


a=1.2, b=6

 

 

Thank You

About Author

Brijesh Kumar

Database Developer

I have more then 6 years Experience in Microsoft Technologies - SQL Server Database, ETL Azure Cloud - Azure SQL Database, CosmosDB, Azure Data Factory, PowerBI, Web Job, Azure Function, Azure Storage, Web Apps, Powershall and Database Migration On-Premise to Azure Cloud.
LinkedIn : https://www.linkedin.com



Comments