Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

EXPERT C OPERATOR REIMPLEMETATION

Name: Anonymous 2014-04-12 8:41


#include <stdio.h>

bool
or (bool a, bool b)
{
return a ? true : (b ? true : false);
}

bool
and (bool a, bool b)
{
return a ? (b ? true : false) : false;
}

bool
not (bool a)
{
return a ? false : true;
}

Name: Anonymous 2014-04-12 15:00

>>8
#include <stdio.h>
#include <stdbool.h>

int main(void)
{
printf("%lu\n", sizeof(bool));
return 0;
}


$ gcc -o a a.c -std=c99 && ./a
1


Care to tell me what type of machine you're running on where the above prints `0' instead?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List