Thank you both for the replies.
I understand

I actually read more about it and found this PDF -
https://www.ti.com/lit/sg/sdyu001ab/sdyu001ab.pdf - in particular page 4, which shows the levels of CMOS and TTL.
Though I have to say I'm not sure I fully understand why TTL output high cannot go higher than 2.4V? For ex I found this diagram of a TTL inverter (attached below)
If the input is low, the output is high, coming from a 5V supply through a 160ohm res, a saturated NPN and a diode.
Say we connect this to a CMOS input, which is basically a mosfet gate, i.e. very low current needed.
With very low current the voltage drop through the resistor, the NPN and the diode will be very low as well, say in total <.5V, so that would mean an ouput of 4.5V minimum... Or am I missing something?