有没有办法在 gdb 中打印 char** 类型的变量?
is there a way to print a variable of type char** in gdb?
有没有办法在 gdb 中打印 char** 类型的变量?
我的意思是,假设 .c 文件和 gdb 中有一个变量 int length = 17;
,键入 p length 将显示 length = 17。但是,如果它是 char**,有没有办法打印它并查看该变量中的 characters/strings ?一直在 google 上搜索,但找不到任何信息。
However, if its of char**, is there any way to print it and see the characters/strings inside that variable?
该变量中没有个字符/字符串。
您可能会问:我可以打印 *var
指向的字符串吗?在这种情况下,print *var
或 print var[0]
都可以。
有没有办法在 gdb 中打印 char** 类型的变量?
我的意思是,假设 .c 文件和 gdb 中有一个变量 int length = 17;
,键入 p length 将显示 length = 17。但是,如果它是 char**,有没有办法打印它并查看该变量中的 characters/strings ?一直在 google 上搜索,但找不到任何信息。
However, if its of char**, is there any way to print it and see the characters/strings inside that variable?
该变量中没有个字符/字符串。
您可能会问:我可以打印 *var
指向的字符串吗?在这种情况下,print *var
或 print var[0]
都可以。