Hello everyone thanks for your time and guidance, I am having issues with my code working correctly. The code will be included for reference but my main issue is within the function defition ```void read_file(Cars cars[], Cars validCars[], Cars errorCars[]) {
// Function to read from input file
ifstream inputFile("input.txt");
string line;
int carIndex = 0;
int validIndex = 0;
int errorIndex = 0;
while (getline(inputFile, line)) {
stringstream ss(line);
string itemID, itemName, manufacturer;
int quantity;
if (getline(ss, itemID, ',') && getline(ss, itemName, ',') && getline(ss, manufacturer, ',') && ss >> quantity) {
Cars car;
car.CarID = itemID;
car.CarModel = itemName;
car.Manufacturer = manufacturer;
car.Amount_on_Hand = quantity;
if (car.isValidRecord()) {
validCars[validIndex++] = car;
} else {
errorCars[errorIndex++] = car;
}
cars[carIndex++] = car; // Add the car record to the cars array
}
}
inputFile.close();
} its supposed to be able to look at records from an input.txt file ive formatted as follows : 129XYZ6 Explorer Ford 8 24000.00
134ABC5 Civic Honda 15 17000.00
117PQR9 Malibu Chevrolet 26 20000.00
128LMN3 ModelS Tesla 18 40000.00
122RST5 Outback Subaru 25 22000.00
139UVW2 F-150 Ford 12 28000.00
118GHI4 Prius Toyota 30 19000.00``` but whenever i run the program it mostly just returns 0's. I add a link to the full code just in case more info is needed : https://sourceb.in/Wrvr04hKCK