Skip to content

Instantly share code, notes, and snippets.

@steshaw
Created September 1, 2021 09:36
Show Gist options
  • Save steshaw/262490b86b25c5673bb2ecfbc01b4888 to your computer and use it in GitHub Desktop.
Save steshaw/262490b86b25c5673bb2ecfbc01b4888 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdbool.h>
static void truthy_int(int i) {
if (i) printf("%d is true\n", i); else printf("%d is false\n", i);
}
int main() {
truthy_int(-1);
truthy_int(0);
truthy_int(1);
bool t = true;
bool f = false;
printf("false = %d\n", f);
printf("true = %d\n", t);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment