Need Help With A Lab Problem

Page 1 of 1

1 Replies - 131 Views - Last Post: 05 September 2012 - 02:53 PM Rate Topic: -----

#1 Schlosh08  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 0
  • View blog
  • Posts: 28
  • Joined: 03-June 12

Need Help With A Lab Problem

Posted 05 September 2012 - 02:50 PM

I am trying to convert java code to c++ code and right now when I am trying to compile my c++ code i get this error in the terminal
 120: error: no match for ‘operator=’ in ‘customers[i] = (((BookStoreCustomer*)operator new(24u)), (<anonymous>->BookStoreCustomer::BookStoreCustomer(), <anonymous>))’
A1-BookStoreCustomer.h:15: note: candidates are: BookStoreCustomer& BookStoreCustomer::operator=(const BookStoreCustomer&) 


and then this is where the error is occuring somewhere in this chunk of code
   // Wait for user to enter the number of customers                             
  cout << "Enter number of Customers: ";
        cin >> numCust;
        customers = new BookStoreCustomer[numCust];

  // get customer data on number of books purchased                             
  for (int i = 0; i<numCust; i++) {
          cout << "Enter data for Buyer " + (i+1);
          customers[i] = new BookStoreCustomer();
          customers[i].readInput();
  }


Is This A Good Question/Topic? 0
  • +

Replies To: Need Help With A Lab Problem

#2 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 9027
  • View blog
  • Posts: 33,486
  • Joined: 27-December 08

Re: Need Help With A Lab Problem

Posted 05 September 2012 - 02:53 PM

Please avoid duplicate posting.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1