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 8:50

#include <stdio.h>
why

Name: Anonymous 2014-04-12 8:51

/prog/read/1397299302/1:4:1: error: unknown type name ‘bool’
bool
^
/prog/read/1397299302/1:5:5: error: unknown type name ‘bool’
or (bool a, bool b)
^
/prog/read/1397299302/1:5:13: error: unknown type name ‘bool’
or (bool a, bool b)
^
/prog/read/1397299302/1:10:1: error: unknown type name ‘bool’
bool
^
/prog/read/1397299302/1:11:6: error: unknown type name ‘bool’
and (bool a, bool b)
^
/prog/read/1397299302/1:11:14: error: unknown type name ‘bool’
and (bool a, bool b)
^
/prog/read/1397299302/1:16:1: error: unknown type name ‘bool’
bool
^
/prog/read/1397299302/1:17:6: error: unknown type name ‘bool’
not (bool a)
^

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