Cannot implicitly convert type 'char*' to 'bool'
<p>The program below is from the book "Cracking the coding interview", by Gayle Laakmann McDowell.</p>

<p>The original code is written in C.</p>

<p>Here is the original code:</p>

<pre><code>void reverse(char *str) {
    char * end = str;
    char tmp;
    if (str) {
        while (*end) {
            ++end;
        }
        --end;
        while (str &lt; end) {
            tmp = *str; 
            *str++ = *end; 
            *end-- = tmp;  
        }
    }
}
</code></pre>

<p>I am trying to convert it in C#.  After researching via Google and playing with the code, below is what I have.  I am a beginner and really stuck.  I am not getting the value I am expecting. Can someone tell me what I am doing wrong?</p>

<pre><code>class Program
{        
    unsafe void reverse(char *str)
    {
        char* end = str;
        char tmp;
        if (str) // Cannot implicitly convert type 'char*' to 'bool'
        { 
            while(*end) // Cannot implicitly convert type 'char*' to 'bool'
            {
                ++end;
            }
            --end;
            while(str &lt; end)
            {
                tmp = *str;
                *str += *end;
                *end -= tmp;
            }
        }
    }

    public static void Main(string[] args)
    {
    }
}
</code></pre>
