I have a pointer to an wide char array, which I want to free.
What is the easiest way to do this?
I have a pointer to an wide char array, which I want to free.
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.
That depends on how the memory was allocated.
If
malloc()was used, pass the address of the allocated memory tofree(). If it came from a third-party library, see that library’s documentation. If the struct is actually a local or global variable, don’t worry about cleaning it up at all.