QByteArray class input to function - pass by reference or pass by value???
When passing a QByteArray variable to a function, is the variable pass by reference or pass by value?
I have the following code in my program:
- // global variable
- QByteArray RX_Buffer;
- // In one of my function, I am passing RX_Buffer to a function
- // state machine processing to populate values to rx_data
- for(int i = 0; i < 10; i++)
- rx_data[i] = (quint8)i;
- bool cls_ElectricityMeter::ReadDemo()
- ParseMessage(TX_Buffer, RX_Buffer);
- return false;
At the return point of ReadDemo function, RX_Buffer.data() does not contain the populated values from ParseMessage. Am I doing something wrong?