char* vs std::string.data()
I’m using a Azure IoT Hub to send and receive messages to and from a device. To do this, I’m utilizing a library written in C and my application is written in C++. When I convert my std::string to a char* with the data() function to send a message with the C library, the start of the text gets mangled when I receive it in the hub.