Perform Operator Overloading In C Without Error.

Asked By 0 points N/A Posted on -
qa-featured

I am always on the move while learning a programming language. This time I am stuck with C. I need to perform operator overloading in C without error. How do I do that?

SHARE
Answered By 20 points N/A #294645

Perform Operator Overloading In C Without Error.

qa-featured

Ad hoc polymorphism or operator overloading is a peculiar case where operators implement with different results by their arguments. But, programmers can reassign the semantics of operators by the operand’s type. C itself does not directly support the operator overloading. There are tools that assist the C language to achieve operator overloading.

The host tools such as Lex and Yacc can help you to overload the operators. You can also go for syntactical sugar which is using the similar syntax in C and C++. As everything C++ can do, C can also do, use syntactical sugar seems to be the viable option. But, as I said, C doesn’t support operation overloading by itself.

Related Questions