//Takes index as argument. Function should return the reference to object at index. (Rowrevenues is a Vector with objects).
//Returns the reference to the object stored at index (object is a specific purchace with 3 member variables).
const TicketManagment TicketManagment::getAllRevenues(int &index) const {
if (index >= 0 && index < Rowrevenues.size())
return &Rowrevenues.at(index);
else
return 0;
}
In a function in my main() file I have the following code to get at the specific member variables via their get-functions:
//Loop wich writes all contents to file
for (int index = 0; index < manage.getRowRevenuesSize(); index++){
const TicketManagment purchase = manage.getAllRevenues(index);
DataToFile = purchase->getSeatRow() + (";") + purchase->getPriceTotal() + (";") + purchase->getNumberofTickets();
//Content is written to a CSV-type file
transfer.WriteToFile(FILEPATH_REVENUES, DataToFile, false);
}
I'm really not sure on what the proper syntax is in order to get this to work. I've been at it a while and I've run out of luck...

New Topic/Question
Reply




MultiQuote



|