I created an XOR true table using some of my old C language knowledge,
I showed my tutor and he said that creating such a table is considered redundent, but others argue it can be used to inplement C++'s flexability.
Here is the coce... What do you guys think about my tutors comment and the argument in general?
Personally, I think it is rather helpful.
Code:
#include <iostream>
using std::cout;
using std::endl;
// main function
int _tmain(int argc, _TCHAR* argv[])
{
bool p, q;
p = true;
q = true;
cout << p << " XOR " << q << " is " <<
( ( p || q ) && !( p && q ) ) << "\n";
p = false;
q = true;
cout << p << " XOR " << q << " is " <<
( ( p || q ) && !( p && q ) ) << "\n";
p = true;
q = false;
cout << p << " XOR " << q << " is " <<
( ( p || q ) && !( p && q ) ) << "\n";
p = false;
q = false;
cout << p << " XOR " << q << " is " <<
( ( p || q ) && !( p && q ) ) << "\n";
getchar(); // freeze output
return 0; // indicatres sucsessful termination
}