Help with Debugging a Program Using reinterpret_cast

  • Thread starter Thread starter yungman
  • Start date Start date
Click For Summary
The discussion centers on debugging a program that uses `reinterpret_cast` to write integers to a text file, which results in unexpected hexadecimal representations instead of the intended character output. The program originally attempts to display integers as characters, leading to confusion about the output format. It is clarified that `reinterpret_cast` is not specific to binary files but is used for type conversion in C++. The successful approach involves writing to a binary file, which correctly stores and retrieves mixed data types, including structures. The conversation also highlights the importance of understanding data representation and the implications of using text versus binary files for different data types.
  • #31
Mark44 said:
...... When the debugger is running, you can evaluate any expression that involves variables that are in scope using the Immediate window.
Debug --> Window --> Immediate
Just type the expression you want to evaluate, and its value will be shown in the window.
I thought you mean to type in the program, now I know type in the Immediate window.

Thanks
 
Technology news on Phys.org
  • #32
yungman said:
I thought you mean to type in the program, now I know type in the Immediate window.
If you think about this a minute, it doesn't make any sense. To be using the debugger, you must already have typed in the program. Plus, I said the type the expression you want to evaluate. That doesn't mean "type the program."
 
  • #33
Mark44 said:
If you think about this a minute, it doesn't make any sense. To be using the debugger, you must already have typed in the program. Plus, I said the type the expression you want to evaluate. That doesn't mean "type the program."
Yeh, but ALL the windows opened in debugger were just show what's in it, It's NOT for me to do anything. Don't blame me thinking not to type in the window. I did type in the program and tried. It's not as if I don't read your suggestion.
 

Similar threads

Replies
10
Views
2K
Replies
5
Views
2K
  • · Replies 36 ·
2
Replies
36
Views
4K
  • · Replies 65 ·
3
Replies
65
Views
7K
  • · Replies 75 ·
3
Replies
75
Views
6K
  • · Replies 30 ·
2
Replies
30
Views
4K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 89 ·
3
Replies
89
Views
6K
  • · Replies 16 ·
Replies
16
Views
4K
  • · Replies 6 ·
Replies
6
Views
2K