mercredi 12 juillet 2017

error: no match for 'operator>>' (operand types are 'std::istream

I am reading the c++ primer 5th edition.I have a bare bones Sales_item class. This is main.cpp file.

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

int main() {
int a;
Sales_item book;
std::cin >> book ;
}

I get error:

error: no match for 'operator>>' (operand types are 'std::istream {aka std::basic_istream<char>}' and 'Sales_item')

Aucun commentaire:

Enregistrer un commentaire