C ++ escape code parameter

I am looking through code from one of our clients and found this function parameter that I had never seen before:

some_function('ESFc'); 

In the debugger, I set the value

 char c = 'ESFc'; 

and it is equal to 99

It also uses β€œESSc,” β€œESCm,” and β€œESBd,” which are 99, 109, and 100

What is it? Is this some kind of exit code?

+4
source share
1 answer

This is a multi-character literal, but its value is not 99. The type 'ESFc' is actually an int , and when you store it in a char , it loses precision. See this question:

What do single quotes do in C ++ when using multiple characters?

+7
source

All Articles