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

Visual studio 2010 my compiler.

here is the "Sales_item.h" header file.

http://tny.cz/b7f276dd

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;
    cin>>item>>item2;

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

    {
        cout<<"df"<<endl;
    }


    system("pause");

}

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))
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.