...
Notify will actually use the exact string constructor in the 2nd method if you pass it a pointer, so these two methods are identical. To get your data from ACOMMS_RECEIVED_DATA:
Code Block |
---|
// sayperhaps we didcopied somethingthe like thisstring in OnNewMailonNewMail string msg_string = msg.GetString(); // the .data() method gives us a pointer to the string's data in contiguous memory memcpy(&data_received.packet_id, msg_string.data(), msg_string.size()); |