3 ms·
Well done. Whileone forgets evil macros are, we often forget how versatile they are in that cause. That said, I feel that in practice I have to worry more abo
by adrianratnapala 9y ago
Well done. Whileone forgets evil macros are, we often forget how versatile they are in that cause.
That said, I feel that in practice I have to worry more about this strange hidden behaviour in C++ and Python than in C and JavaScript. And even Python is not so bad if you stick to the standard libraries.
- chias 9y agoUntil you start playing with ctypes, where you can change the values of constants. In Python 3: >>> import ctypes >>> ctypes.memmove(id(5)+24, id(23)+24, 8) >>> 2 2 >>> 3 3 >>> 2 + 3 23 Or, similarly for Python 2 >>> import ctypes >>> ctypes.cast(id(4),ctypes.POINTER(ctypes.c_int))[4]=5 >>> 2 2 >>> 2 + 2 5