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 13:54

>>7
Because of all the type conversions that have to be done. It was a quote off of usenet but he was addressing a question which asked when to use each integral type.

His response was along the lines of:
long if you need a larger range than int will provide
char if you desperately need to save memory
and int otherwise

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