Is there a way to specifically clear a variable?
Is there a way to specifically clear a variable?
It depends on what you mean by clearing and what kind of variable you mean.
I want to clear a char. I'm using borland c++.
Assume c is a variable of type char then you can clear it by:
c = '\0';
Is there anything more specific than that because it doesn't seem to work on borland c++.
c^=c;
Free the weed!! Class B to class C is not good enough!!
And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi
Not to be rude but could you be a little more specific, Stoned Coder? Or could someone, please, define what he just said?
c^=c;
is a piece of sourcecode that will set c to zero.
You cannot 'clear' a variable. A variable always has a state. You can define one as clear, like zero, but the variable will always have a value.
hth
-nv
She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."
When in doubt, read the FAQ.
Then ask a smart question.
Doesn't work... do you need any header files?
Can you post the offending code.
I'd like to see this mutinous variable in action
Last edited by C_Coder; 02-10-2002 at 02:20 PM.
This might make it easier... how do you clear a coordinate ... with gotoxy?
Are you trying to clear a point on the screen or a variable in memory.
At the start of this thread it sounded like you wanted to clear the variable, now you mention gotoxy it's sounds like you want to clear a point on the screen.
Which is it???????????????????????????
drdroid, your question isn't exactly specific. To get help, you need to give us the details of your problems.
It's a point on the screen. Noone answered the first question so I changed it to see if there was a responce. How do you clear a specific point on the screen?
I'm creating a maze editor in which you create walls then move on to create more walls. I don't want to delete the whole thing, just the asterisk(the pointer, or mouse that you move around to create walls).