josemartindev
josemartindev

Reputation: 1426

Is there a C library function that returns bool?

I was wondering, is there any library function (like printf, scanf, read, malloc) in C that returns a bool type?

Like for example a function to verify actions like comparing strings e.g: (bool isEqual(char *s, char *s)) or which number is bigger (bool AIsBiggerThanB(int a, int b)). I've been programming in C since 1 year and I've always used 0 and 1, and as we all know, bool was introduced to C in C99. So, is there any new functions along the addition of stdbool.h ?

Upvotes: 0

Views: 247

Answers (1)

Sourav Ghosh
Sourav Ghosh

Reputation: 134286

First of all, usage of a(ny) new type is not likely to change the existing prototypes / implementations unless there was an error/problem inherently.

That being said, the "Atomics" <stdatomic.h> declare some of the functions returning _Bool. Check §7.17 in C11, if you need more info on this.

Upvotes: 2

Related Questions