Ad
  • Default User Avatar

    || is the OR operand. So if the first case passes (in this case i == 0), then it will skip trying to validate the second case (str[i-1] == ' ').

    Since i is always 0 on the loop's initialization, then it will never try to validate str[i-1] == ' ' on the first pass