Cannot implicitly convert type 'char*' to 'bool'
- by neeraj
i was trying to passing pointer value in the function ,
i really got stuck here I am a beginner , not getting what value should be put
this is programme from the reference of the book "Cracking the coding interview " By Gayle Laakmann McDowell,
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<end)
{
tmp = *str;
*str+= *end;
*end-= tmp;
}
}
}
public static void Main(string[] args)
{
}
}