trigraphs - meaning of `???-` in C++ code -
this question has answer here:
- what c ??!??! operator do? 4 answers
i saw following code legacy codes:
size_t = 1 ???- 2 :0;
what symbol ???-
mean in c++? how should understand it?
thank you!
it's actually:
size_t = 1 ? ~2 :0;
??-
trigraph ~
trigraphs old era... before of born.
back in days, there characters weren't supported. unknowing programmer try type in such character find doesn't exist on keyboard!
image source: http://www.myoldmac.net/cgi-data/forum/phpbb2/viewtopic.php?t=305
so trigraphs added allow programmer access functionality of these characters when didn't exist (either in encoding or keyboard).
nowadays, obsolete , more effective in confusing reader in getting around old standards.
so either code old, or author being jerk.
Comments
Post a Comment