• Register
300 points
8 4 2

Want to solve programming problems and get paid for it? If that sounds interesting to you then contact us.

The binary error occurs when the programmer forgets to include a string which is a sequence of characters, variables, or symbols. When a string is not used, the compiler indirectly imports parts of a string into its iostream which renders the process unreliable. The iostream can also break because the operator lacks strings to implement the algorithm. An operator is a symbol that tells the compiler to perform a specific mathematical function or a logical operation. There are different operators in the C++ programming language:

 

  • Arithmetic operators 

  • Relational operators 

  • Logical operators 

  • Bitwise operators 

  • Assignment operators 

  • Misc operators

More info

A programmer is always supposed to include and specify the operator in the syntax for a program else the error of no operator found. 

Another reason you can get such an error is that the operator is overloaded, which results in user codes behaving abnormally. Sometimes when there is a mismatch or the rules of operators are not observed between the left-hand and right-hand operands, similar errors occur and user codes cannot run. 

The basic concept when using operators is that they should be assigned and defined to a class and the former should have a copy of the constructor and an assignment operator defined.

Illustration; 

Point :: Point (const Point&);

and

Point& Point :: operator= (const Point &);


Example

#include "stdafx.h"
#include <iostream>

using namespace std;

int main()
{
    string title = "THE WORLD OF PIRATES";
    cout << title << endl;
    cout << " Welcome to the world of pirates";

    cin.get();

    return 0;
}

Error is defined as 

binary '<<' : no operator found which takes a right-hand operand of type 'std::string' (or there is no acceptable conversion)

Solution

Here we forget to #include <string>

std::string can work without including header file in some compilers because they directly import parts of <string>. They can also break when we try to output the string since they only include a part of the implementation and the operator « was missing from the implementation.

Hope this helps.

300 points
8 4 2