There’s probably a silly error in my code. I have defined the following variables:
unsigned char uEngines;
unsigned short uActiveEngines
unsigned short uDed
....
and a few others.
Elsewhere in the code, I tried to print the structure in the gdb and got the following .
$6 = {uEngines = 12 '\f', uActiveEngines = 4095 .....
1) I am trying to output the uEngines value using cout, but it’s only outputting a blank space:
cout <<strVariable->uEngines;
2) what does ‘\f’ mean in the gdb output ?
Am I doing something wrong with data type ?
It’s a formfeed, one of the non-printable characters in the ASCII character set below space.
It’s meant to do a “page advance” operation on whatever device you send it to, assuming that the device supports it.
12is the decimal value as shown below:Because it’s a
char,std::cout << uEngines;will output it as a character rather than an integral value. If you want it as in integral value, cast it to one: