November 7th, 2012, 01:17 AM
Originally Posted by serafon
word is a pointer and null is zero so you can increment address one by one and you dereference the pointer until you reach zero.
No, word is an array, not a pointer. You cannot increment or decrement an array name. As we are taught: array names are for the most part equivalent to pointers. This is one of the cases where that general rule does not apply.
Rather, declare a char pointer and initialize it to word, then increment the pointer.