About 267,000 results
Open links in new tab
  1. Writing a function in C that returns a boolean - Stack Overflow

    Dec 15, 2013 · Using 'bool' or 'BOOL' will only get you into trouble when you include a 3rd party library. The only exception would be to use the de-facto standard of: #define BOOL int #define …

  2. How to work with a Boolean function in C in this code

    Aug 17, 2023 · I'm going to guess it doesn't know what bool and true are. bool is not a primitive data type in C. You need an extra include: #include <stdbool.h> The second part of your …

  3. c++ - How to correctly use Boolean functions? - Stack Overflow

    inline bool Divisible( int n, int m ) { return ( n % m == 0 ); } or (C) inline _Bool Divisible( int n, int m ) { return ( n % m == 0 ); } In the last case you may substitute return type _Bool for int. In the …

  4. Using Boolean values in C - Stack Overflow

    bool and _Bool, and true and false are language keywords for boolean types. bool/_Bool is a type that can hold either the value true or false. Logical operators!, ||, and && can be used. A scalar …

  5. Is boolean return type allowed in C? - Stack Overflow

    Oct 3, 2015 · bool does not exist as a keyword pre-C99. In C99, it should work, but as @pmg points out below, it's still not a keyword. It's a macro declared in <stdbool.h> .

  6. function - How to return a boolean in C? - Stack Overflow

    May 21, 2021 · Using Boolean values in C (19 answers) Closed 3 years ago . I'm trying to create a function which should return true or false if a given number complies with the given conditions.

  7. c# - Method with a bool return - Stack Overflow

    Feb 16, 2017 · I was making a method with a bool return value and I had a problem: This works private bool CheckAll() { //Do stuff return true; } But this dosn't, the method can't detect a …

  8. What is the difference between BOOL and bool? - Stack Overflow

    Dec 14, 2019 · The values for a bool are true and false, whereas for BOOL you can use any int value, though TRUE and FALSE macros are defined in the windef.h header. This means that …

  9. Which header file do you include to use bool type in C?

    2 The macro bool expands to _Bool. 3 The remaining three macros are suitable for use in #if preprocessing directives. They are. true which expands to the integer constant 1, false which …

  10. c - How to Call A simple Bool function and print - Stack Overflow

    Jul 29, 2015 · I am trying to learn how to call functions and work with bools. Tried running a small test by calling a bool function that is true if an input number is less than 50.

Refresh