[TUHS] v7 K&R C

Paul McJones paul at mcjones.org
Thu May 14 13:02:03 AEST 2020


> On May 13, 2020, at 7:00 PM,Dave Horsfall <dave at horsfall.org> wrote:
> 
> I never could figure out why Stroustrup implemented that "feature"; let's 
> see, this operator usually means this, except when you use it in that 
> situation in which case it means something else.  Now, try debugging that.

C continues the tradition begun by Fortran and Algol 60 of overloading the arithmetic operators on the various numeric types. C++ allows new types to be defined; when a new type obeys the generally understood properties of a built-in type, it makes sense to use the same operator (or function) for the corresponding operation on the new type (e.g., addition on complex numbers, arbitrary-precision integers and rationals, polynomials, or matrices).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20200513/23596050/attachment.htm>


More information about the TUHS mailing list