So I have a struct, and there I would like to access specific values from within it in another method. I am not allowed to modify the struct itself. Here is the struct and a couple of functions that are used to initialize and access it.
struct StdCardConfirmationReceipt
{
private:
std::string sOfrIdOrderCentral;
std::string sOrderIdOrderCentral;
std::string sFulfillmentOrderIdOrderCentral;
public:
StdCardConfirmationReceipt()
{
sOfrIdOrderCentral = "";
sOrderIdOrderCentral = "";
sFulfillmentOrderIdOrderCentral = "";
}
StdCardConfirmationReceipt& operator=(const StdCardConfirmationReceipt& source )
{
sOfrIdOrderCentral = source.sOfrIdOrderCentral;
sOrderIdOrderCentral = source.sOrderIdOrderCentral;
sFulfillmentOrderIdOrderCentral = source.sFulfillmentOrderIdOrderCentral;
}
I would like to get these values 'sOFrIDOrderCentral' and sFulfillmentOrdIdOrderCentral' and put it in another struct. Is this possible with the above code? Here is the for-loop I'm using in the other method to access the struct.
for(std::vector<StdCardConfirmationReceipt>::iterator vIter= mvCardConfirmationReceiptList.begin(); vIter != mvCardConfirmationReceiptList.end(); ++vIter)
{
//need to accesss OFrIDOrderCentral and sFulfillmentOrdIdOrderCentral
}