0

I was wondering if it was possible to create a temporary variable in C# that will be destroyed at the end of the function so I can use that variable name elsewhere in another function. Can anybody help me out?

2
Contributors
1
Reply
9
Views
5 Years
Discussion Span
Last Post by sepp2k
1

Variables that are declared inside a method will always go out of scope at the end of that method. You don't need to do anything special to make it that way.

Votes + Comments
Never knew this. Thank you.
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.