Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. class base{
  2. protected:
  3. string model
  4. class Coins
  5. vector<Products> somename
  6. public:
  7.  
  8. base(model,q,d,n)
  9.  
  10. setproducts(selec, b, c, string a, int d)
  11. itemsInMachine.push_back({ selec, b, c, a, d });
  12.  
  13. };
  14. //main
  15.  
  16. vector<baseClass*> listOfMachines;
  17. while(inf.eof()){
  18. int q,d,n,sizeofitems
  19. inf >> modelname >> numberOfMachines
  20. for(int i =0; i = numberOfMachines; i ++){
  21. if(modelname == "100A"){
  22. inf >> q >> d >> n >> sizeOfItems;
  23. listOfMachines.pushback(modelname+to_string(i+1),q,d,n);
  24.  
  25. for(int j =0;j <sizeOfItems;j++){
  26. listOfMachines[i]->setProducts(string select, int b, int c, string a , int d)
  27. }
  28. }
  29. if(modelname == //othertype of machie)
  30. //same procedures with the one on top
  31.  
  32.  
  33.  
  34.  
  35. the output would show that only the firsttwo machine would be initialized correctly and then the rest would be empty
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement