Quote:
|
Originally Posted by bivhitscar
Well, that is extremely simplified, because you can't do this:
char *ptr;
if ( ptr == '\0' );
|
Why not? It's a silly way of doing things, but what's stopping you?
Quote:
|
Originally Posted by bivhitscar
Though, I will mention that the statement while((*s = *t) != '\0') will overwrite memory before checking the value, which isn't very good practice IMO.
|
I wouldn't say that it's bad practice, as it really depends on the algorithm. For instance, for strcpy() you want it to copy the last value, so there's nothing wrong with this. It is good to point out that the assignment happens, but it's only bad if you're not expecting it to.