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
I have char* data; which has a buffer dumped into it. I want to
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Assuming the
char*isNUL-terminated, useprintf("%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.