No 'bool' data type in C language. Please correct the signature.


  • 0
    V

    Dear LeetCode,

    I don't think there is a boolean data type in C language. When we select the language as C, it shows the following function signature which I suppose is not correct.

    bool isPalindrome(int x){
    }
    

    Please correct it.

    Thanks.


  • 1
    S

    C++ has a datatype bool, C doesnt have bool data type, but it can be defined by using enum.


  • 1
    S

    C99 added a boolean (true/false) type _Bool.
    New <stdbool.h> header defines bool as a convenient alias for this type, and also provides macros for true and false.


  • 0
    V

    Thanks. Yes <stdbool.h> defines bool type on C99 compiler.


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.