Function | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
0

Function

Anyone can rewrite this code in other ways that would still mean and do the same thing? RentalAgency readagencyandinventory (ifstream &inputFile) { RentalAgency agency; RentalCar car; RentalCar *inventory = agency.inventory; inputFile >> agency.name; fiveDigitArrayFromFile(agency.zipcode, inputFile); for(int i = 0; i < 5; i++) { car = readRentalCarfromFile(inputFile); *inventory++ = car; } return agency; }

20th Sep 2018, 6:40 AM
lakas
1 Respuesta
0
Why refactor it? It seems perfectly fine, and half the work is done in other function
21st Jan 2019, 10:24 PM
Abel Louis
Abel Louis - avatar