I saw one example

int x = 10;
int y = 5;

bool isGreater = x > y;

printf("%d", isGreater);

But I could write this

int x = 10;
int y = 5;

printf("%d", x > y);

I am a complete beginner and I have no real reason why I would or would not want to deal with boolean variables, but I want to understand their raison d'être.

Edit: typo city

you are viewing a single comment's thread
view the rest of the comments
[–] 2 points 6 months ago

Malloc return 0 is a failure, but open return 0 is success. It's just inconsistent, and it's definitely an age and context thing.

Rust's Result api are a pretty great solution. Not sure what other options are out there though.

  • source
  • parent