\0 is interpreted as the end of a string so appending it to a string will have no useful result without telling the callee the size of the character array. So either don't append null bytes to the array (as it already contains a null character at the end) and/or pass the size of the array to the callee. Or use QByteArray:
Qt Code:
ba.append('\0'); socket->write(ba);To copy to clipboard, switch view to plain text mode
Bookmarks