GDB question: Pretty-Printing a 2D Array?

前端 未结 5 549
温柔的废话
温柔的废话 2020-12-14 22:11

I have a 2d array matrix[10][10] that I\'d like to inspect at debug time.

I understand that I can do this in GDB using

p *matrix@10

5条回答
  •  渐次进展
    2020-12-14 23:05

    You can also use try p (float[n][m])Array to print a 2d array in gdb.
    For example, p (float[3][3])*C

提交回复
热议问题