I’m sorry if this is an obvious question but neither Google or a search here led me to an answer.
Is there a way to remove an array entirely?
I want the opposite of int[] array = new int[5]
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.
Say you call:
In C# there is no way to undefine the variable
a. That meansawill be defined inFooeven if you setato null. However, at the end ofFooawill fall out of scope. That means no code can reference it, and the garbage collector will take care of freeing the memory for you the next time it runs, which might not be for a long time.