Viewing a dynamically-allocated array with the Xcode debugger?

后端 未结 4 1765
自闭症患者
自闭症患者 2020-12-23 14:59

Let\'s say I have an array in C++:

double* velocity = new double[100];

Using the GDB command line, I can view this array with the command:<

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-23 15:21

    As of Xcode 10, you can right-click velocity, choose "View value as..." and then "Custom Type". Then cast it to (double(&)[100]) *velocity and display the array in the GUI.

提交回复
热议问题