This may be a simple error but however. I was running my simple programs as normal and then when i went back to the program later to copy some code there was an error message highlighted underneath the first brace of my main() function.
The error states - error: first defined here
I will provide my code as it may be a setup problem with eclipse but i cant figure it out??
Please can someone help me out here?
#include <iostream>
using namespace std;
int main()
{ // error: first defined here
int a = 1;
int b = 0;
// insert statements to output the statements of AND evaluations
cout << "AND logic:" << endl;
cout << "(a && a)" << (a && a) << "(true)";
cout << "(a && b)" << (a && b) << "(false)";
cout << "(b && b)" << (b && b) << "(true)\n"; // 0 && 0 returns 0 (2 wrongs dont make a right!)
// insert statements to output the statements of OR evaluations
cout << "OR logic:" << endl;
cout << "(a || a)" << (a || a) << "(true)";
cout << "(a || b)" << (a || b) << "(true)";
cout << "(b || b)" << (b || b) << "(false)\n";
cout << endl << "NOT logic:" << endl;
cout << "a = " << a << " !a = " << !a << " ";
cout << "b = " << b << " !b = " << !b << endl;
return 0;
};