You are probably coming from a languange like PHP, where the check is processed different:
php -r 'echo "X";if ("") echo "Y";'
THis will print the X, but not the Y because the empty string has no value.
As others have pointed out, in C++ it's a non-null-pointer, so evaluated as true.