Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
this seems like a no brainer but I can´t for the life of me figure this out...
I tried... @ TX_Buffer.replace(sizeof(TX_Msg), 1, &((DI.mid(2, 2).toInt(&ok, 16) + 0x33) % 256)); @
but get and error : error: lvalue required as unary ‘&’ operand
Try this: @QByteArray ba("Hello world"); char *data = ba.data(); ba.data()[1] = 'B'; qWarning() << ba; //shows "HBllo world" @
size() always returns 11.
Your third argument
@&((DI.mid(2, 2).toInt(&ok, 16) + 0x33) % 256)@
to replace is not an C++ object (which you can get an address with &), but an integer.
Danilo: @ba[1] = 'B';@ should do the trick even shorter
Outch, my bad... You're right.
No problem - it was a long and hard week, so even the cutest brain gets exhausted sometimes :-)
thanks guys!