Is it possible to overload operators in C?
C does not support overloading of operators or functions. There's no way you can redefine <
, <=
, >
, >=
, ==
, or !=
to compare struct types directly.
No, it is not possible. C does not support operator overloading by the developer.
If by overload, you mean user defined operator overloads, then the answer is no. However, some of the predefined operators such as *
, +
etc. are overloaded (if you think about it) for arithmetic types. The *
is special since it also has an overload for de-referencing pointers.