#include <iostream>
#include <cmath>
#include <string>
using namespace std;
string STRING;
bool isEqual(double a, double b)
{
return fabs(a-b) ==0;
}
int main()
{
STRING = isEqual(3,3); <--------HERE'S THE MAIN PROBLEM
cout << STRING;
return 0;
}
I'm having trouble setting the output I get from a boolean, be it "true" or "1" equal to a String.Also is it possible to use boolalpha and combine it with "isEqual()" so I can just type
cout <<isEqual(3,3) and it gives me "true"
instead of having to type "cout << boolalpha<<isEqual(3,3) everytime".