Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2014
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. struct Fish
  2. {
  3. string fishName;
  4. int tank;
  5. int quantity;
  6. double price;
  7. };
  8.  
  9. void readInventory(Fish[], int, int);
  10.  
  11. int main()
  12. {
  13. const int MAX_SIZE = 100;
  14. Fish myArray[MAX_SIZE];
  15. int choice;
  16. int currentSize = 0;
  17.  
  18. readInventory(myArray, MAX_SIZE, currentSize);
  19.  
  20. return 0;
  21. }
  22.  
  23. void readInventory(Fish displayArray[], int maxArray, int arraySize)
  24. {
  25. cout << "readInventory" << endl;
  26. ifstream inputFile;
  27.  
  28. inputFile.open("inventory.dat");
  29.  
  30. int count = 0;
  31.  
  32. while (count < maxArray && inputFile >> displayArray[count]) // This is the line with the Error:
  33. count++; // binary '>>' : no operator found which takes a right-hand
  34. // operand of type 'Fish' (or there is no acceptable
  35. // conversion)
  36.  
  37. inputFile.close();
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement