[Qt-creator] Regarding QByteArray

Kosta userqt at gmail.com
Sun May 24 17:29:39 CEST 2009


Hello, 
Does anyone know how to remove the \0 character from the end my this array ? . 

Although the size() is 5, the byte array also maintains an extra '\0' character at the end so that if a function is used that asks for a pointer to the underlying data (e.g. a call to data()), the data pointed to is guaranteed to be '\0'-terminated.

I have to send some bytes trought the wire and I think this \0 will cause a problem if I send it. I'm using UDP, so I will use the writeDatagram method of QUdpSocket. 
Actually I'm sending SNMP message. 

Any ideas ? 


__________ Information from ESET NOD32 Antivirus, version of virus signature database 4098 (20090522) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-creator-old/attachments/20090524/f63b77ae/attachment.html 


More information about the Qt-creator-old mailing list