You could just try calling it with a few strings, and observing the output you get.

02-22-2005

gamett711221

but why not use s != 0 instead using s != '\0'

02-22-2005

quzah

They're effectively the same thing. However, the character null is in fact '\0'. See the single quotes? That means it's a single character. This single character here is what we call the null character.

Quzah.

02-22-2005

Hannes

The function calculates the length of the string that s points to. *s means the current character in the string and '\0' is the null character with which all strings end. So the function checks for the end of the string and increments x and s by one. In the end, x holds the length of the string.