Created
September 1, 2021 09:36
-
-
Save steshaw/262490b86b25c5673bb2ecfbc01b4888 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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