¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita0
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; }
1 Respuesta
0
Why refactor it? It seems perfectly fine, and half the work is done in other function