Lets say I have a class, which creates object and variables. In main how do I reset that class to null, as if it was (the class run for the first time) first run, but without exitting the main?
Resetting a class
Collapse
X
-
Tags: None
-
I ve noticed that when I write an if statement, because I only want it it reset "if asked for a reset". It doesn't work. But without the if statement it works. Why is that? How do make it work? I want to make the declaration inside the if block to be global. How do I do that?Originally posted by JohnSmith70Lets say I have a class, which creates object and variables. In main how do I reset that class to null, as if it was (the class run for the first time) first run, but without exitting the main? -
if I put it outside the block, it would reset it even if I don't want it to.Originally posted by JonLTif you declare anything inside an if block the variable will run out of scope i.e end to exist when you are nolonger inside the if block, you need to put the declaration outside the if blockComment
-
Comment