How to print out the memory contents of a variable in C?

后端 未结 9 722
滥情空心
滥情空心 2020-12-13 14:48

Suppose I do a

double d = 234.5;

I want to see the memory contents of d [the whole 8 bytes]

How do I do that?

9条回答
  •  南方客
    南方客 (楼主)
    2020-12-13 15:13

    If you're looking to view this from gdb you can issue:

    x /gx d
    

    The g will print the value as a giant (8 bytes)

提交回复
热议问题