struct headl{ quint32 sizeDate; quint32 titMsg; QString nameFile;}
QByteArray arrBlock;headl objHead;objHead.sizeDate = 10;objHead.titMsg = 1;objHead.nameFile = "Hello";arrBlock.append((const char*)&objHead,sizeof(objHead));m_pTcpSocket->write(arrBlock);
tcpSocet->read((char*)&objHead,sizeof(objHead));
QString wayFile;objHead.name[i] = wayFile.at(i).toAscii();
C++ (Qt)QByterray arr;QDateStream stream(&arr);stream << objHead.sizeDAte << objHead.titMsg << objHead.nameFile;m_pTcpSocket->write(arr);
QDataStream stream(tcpSocet);stream >> objHead.sizeDate >> objHead.titMsg >> objHead.nameFile;
struct headl{ quint32 sizeDate; quint32 titMsg; char name[1024];}