The NULL Pointer is by definition not required to have the value 0, but is merely an always "invalid" pointer. A C string is not null terminated - it is zero terminated. The correct way is st\len\ = '\0' or st\len\ = (char)0. Though other methods of assigning a zero value to the last byte may work, thay are not necessarily correct.