I understand that the code below is outputing the result of a boolean question but i do not understand why it outputs 1 and 0 instead of 1 and 1.
#include <iostream>
using namespace std;
int main()
{
string d = "abc", e = "abc";
char a[] = "abc", b[] = "abc";
cout << (d == e);
cout << (a == b);
return 0;
}
//outputs 10
i also tried outputing the value stored in variables a and b and got the same value for both
#include <iostream>
using namespace std;
int main()
{
string d = "abc", e = "abc";
char a[] = "abc", b[] = "abc";
cout << (d == e);
cout << (a == b);
cout << "\n" << a << "\n";
cout << b;
return 0;
}
// outputs 10
//abc
//abc