开发者

Print pointervalue

开发者 https://www.devze.com 2023-03-12 19:33 出处:网络
I 开发者_开发问答have char* data; which has a buffer dumped into it. I want to view the content of this char*. I do not know the size of this pointer data so How do I print it?! Thank youAssuming the

I 开发者_开发问答have char* data; which has a buffer dumped into it. I want to view the content of this char*. I do not know the size of this pointer data so How do I print it?! Thank you


Assuming the char* is NUL-terminated, use printf("%s\n",data);.

If the data are not NUL-terminated, this may cause a segmentation fault.

If your data have some format other than ASCII characters, you're going to need to write some code to print it.

0

精彩评论

暂无评论...
验证码 换一张
取 消