int 0 and NULL '\0' are the same. '0' is different (usually 48). Since the string contains '\0' and not '0', therefore you are not printing '0'.