-10

What does these conditions mean in C++:

if (whereto)
if (!nE)
for (cur=first; cur; cur=cur->next)
if (del->prev)

I am still beginner in C++. learned the basic conditions but those conditions are not clear for me. What do the expressions whereto, !ne, cur, and del->prov mean in a conditional

Could someone give me a hint?

dbush
  • 205,898
  • 23
  • 218
  • 273
Nano
  • 57
  • 1
  • 9

1 Answers1

6

Those expressions are being evaluated in a boolean context.

Here, a value of 0 (or NULL) is false, while any non-zero (or non-null) value is true.

So the above is equivalent to:

if (whereto != 0)
if (nE == 0)
for (cur=first; cur != NULL; cur=cur->next)
if (del->prev != NULL)
dbush
  • 205,898
  • 23
  • 218
  • 273