Changing variable to a different type

To change a variable to a different type:
  1. In the Variables view, right-click the variable.
  2. Select one of the following:
    Option Description
    Cast To Type… Cast the variable to the type you specify in the field (e.g. int).
    Restore Original Type Cancel your Cast To Type command.
    Format, followed by a type Show the variable in a different format (e.g. hexadecimal).
    Display As Array Show the variable as an array with a length and start index that you specify. This option is available only for pointers.
Related concepts
Using breakpoints and watchpoints
Inspecting your registers
Inspecting a process's memory
Inspecting shared-library usage
Monitoring signal handling
Viewing your output
Interacting with GDB
Related tasks
Inspecting variables
Changing variable values
Controlling the display of variables
Viewing variables in memory
Evaluating your expressions