View Single Post
Old May 24th, 2006, 2:49 AM   #6
darthsabbath
Newbie
 
Join Date: Dec 2005
Posts: 15
Rep Power: 0 darthsabbath is on a distinguished road
Quote:
Originally Posted by bivhitscar
Also, one other thing I saw you try:

((s = t) != '\0')

When testing the value of a pointer, you need to write it like this (assuming s and t are pointers):

((s = t) != NULL )

The \0 is the ascii representation of null, where NULL is referring to a null pointer. This is a little annoying, but you'll get it eventually.
Just a question here... the code I was testing was from K&R, testing to see if the current character being pointed to is the string terminating character. In this instance, would one still use NULL?

Thanks for being patient everyone. :-)

Phil
darthsabbath is offline   Reply With Quote