It's been awhile and I seem to have forgotten some of the simplest things... le sigh
1 2 3
char handle[20]; // don't want the handle to get bigger than 20 chars
handle = NULL //won't work, can't convert into to char[20]
handle = "\0" //won't work, can't convert const char to char[20]
i need to be able to 'reset' the handle to an empty state of some sort. this should be super easy.
It would be useful to know what it is you are actually doing to ensure the answers given here are not misleading you. A handle is not normally an array, it is normally a pointer or opaque integer value, which represents a reference to another entity. This being the case, declaring you handle as an array would suggest incorrect semantics.
Maybe you meant to have the array as a buffer and the handle as a pointer that can point to the buffer? You could then set handle to NULL to disable it as necessary.
haha yea I've actually got another thread open where I'm talking with someone and this confused them too.
i'm writing a chat program, in my case i thought 'handle' instead of 'screen name'. so all i wanted was a character array. and i'll have an array of these screen names of a maximum size, and if there is a slot where the screen name is empty (or null) then that means a new person can connect and i would set that screen name to something else.
i'll have to do a find/replace on the word handle in my program though since its such a weird thing though lol