I am looking at some code from one of our customers and found this function parameter I’ve never seen before:
some_function('ESFc');
In the debugger I set the value to
char c = 'ESFc';
and it equals 99
He also is using ‘ESSc’, ‘ESCm’ and ‘ESBd’ which eval to 99, 109 and 100
What is this? Is it some kind of escape code?
It’s a multi-character literal, but its value is not 99. The type of
'ESFc'is actually anint, and when you store it in acharit loses precision. See this question:What do single quotes do in C++ when used on multiple characters?