Quote Originally Posted by CommonTater View Post
For example, you can write strlen in three lines...
Code:
int MyStrLen(char* str)
 { char* ptr = str;                         // don't want to disturb the input pointer.
    while(*ptr++);                           // find the null
    return (int) --ptr - str; }             // return the length
.....

So my advice would be... "Work in smaller blobs"....
While I am sure the function you provided works as intended, I don't understand the logic behind it.

I'm still working from a pretty basic knowledge pool and rather than just using an example I want to understand it prior to using it.

Thanks for the advice, now I need to figure out exactly why that works.