While I was coding a program in C, I came up a question that I could not figure out. I was checking if a condition is met in an if statement but was wondering if there is any difference between the following:
if(ptr != NULL)
or
if(ptr)
To me, I feel like both of those are correct but in the C world, the second one would be used more and in the Java world, the first one is used more. Is one more correct then the other?