Suppose I define a variable int a; and I want to be able to use the
same name a for a string variable or an int variable or any sort of
variable later on...how can I undefine it so I can do this?
You cannot undefine a variable. The name (and the definition) persists
to the end of the scope, which means you need to define your variables
each in its own scope, if you would like to reuse the name.
That said, two thoughts come to mind. First, don't name your variables
'a'. It's non-informative. It's better if the variable name is
self-documenting. Second, if you think you could reuse the name, it
sounds that either the name is too generic, or your algorithm should
probably be split into two portions and each wrapped in a function.
What is your intention in reusing the name? Obfuscation? Hope not.
Are you trying to optimize something? If yes, what? Also, it is quite
useful to post your code (even with parts removed) to illustrate your
points.
V