Is it possible to overload an operator for a built-in type? And if so what is it's syntax?

//Use of overloaded operator^ for types double and double (assuming it is overloaded for exponent):
double a=10.0;
double b=2.5;
double pow=a^b;//pow is approximately 316.22....

In order to do what you want you need to 'wrap' the type in a class and provide operators through that interface.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.