How can I clear the buffer, it is a char variable of unknown size and I want to get all the existing data out, how?
How can I clear the buffer, it is a char variable of unknown size and I want to get all the existing data out, how?
Buffer?
And a char variable can only hold a letter.
You mean you have a pointer or an array?
if pointer:
pointer = NULL;
if array:
for(int i = 0; array[i]!="\0"; i++) {
array[i] = "";
}
Lemme retry.
char dude[500] = "hello there, yes i know i'm cool";
now I want to make the variable of type char NULL, or have nothing in it.
char dude[500] = ""; // no data in it now...
Just asking.... why?
Well anyways, use my method:
for(int i = 0; dude[i]!="\0"; i++) {
dude[i] = "";
}
memset ( dude, '\0', 500 );
-Prelude
My best code is written with the delete key.
ErionD, I did'nt mess with your method much but it did'nt compile unlike Preludes.
I'm setting text in an edit control and if the buffer is'nt empty, it messes up.
Thanks for the help & concern.