Can't access private member declared in class 'Sales_item'

Visual studio 2010 my compiler.

here is the "Sales_item.h" header file.

here is the code that I ge the error

#include <iostream>
#include "Sales_item.h"
using namespace std;

int main()

    Sales_item item;
    Sales_item item2;

    cout<<"Enter item names"<<endl;

    if (item.isbn()==item.isbn ())




line 14 is read

"isbn" is a private member and is a string. The class has an overloaded == operator so you can use that directly

if (item == item2)

or, if that doesn't only compare the ISBN, you can use the "same_isbn" function.

if (item.same_isbn(item2))