Can anybody point me the difference between:
char *var;
delete []var;
and
delete var;
I know in principle what the two are used for (delete array containers and elements, for example), but I've encountered delete[] used on character pointers and I am not sure why to use it like this.
Also, why delete [] works no NULL pointers - meaning, no crashes occur? Can anybody offer me an insight on this?
Thx in advance. [red]Nosferatu[/red]
We are what we eat...
There's no such thing as free meal...
once stated: methane@personal.ro
char *var;
delete []var;
and
delete var;
I know in principle what the two are used for (delete array containers and elements, for example), but I've encountered delete[] used on character pointers and I am not sure why to use it like this.
Also, why delete [] works no NULL pointers - meaning, no crashes occur? Can anybody offer me an insight on this?
Thx in advance. [red]Nosferatu[/red]
We are what we eat...
There's no such thing as free meal...
once stated: methane@personal.ro