Ad
  • Custom User Avatar

    true and false are just constants with int values in c, and bool is typedef for int, so sheep[n] != false actually checks for an int value < 0 or > 1, which is obviously not a valid bool value

  • Custom User Avatar

    in most cases yes, but there is exceptions such as emmbeded devices with limited amount of memory. I think you need to write ur code according to the platform y're writting for

  • Custom User Avatar

    (sheep[n] != false)
    You dont need to check this point in C, cuz you can't declare an array with different datatypes.
    As well as pass it into args to count_sheep function.