Hi,
Is it possible to send unsigned char value over network without using QDataStream and QByteArray
...................
unsigned char z=';';
z=z>>5;
clientConnection->write(z);
...................
unsigned char z=';';
z=z>>5;
clientConnection->write(z);
To copy to clipboard, switch view to plain text mode
I get error
error: invalid conversion from 'unsigned char' to 'const char*'
if I do like this
unsigned char z=';';
z=z>>5;
out << z;
clientConnection->write(z);
unsigned char z=';';
z=z>>5;
QByteArray ba;
QDataStream out(&ba, QIODevice::WriteOnly);
out << z;
clientConnection->write(z);
To copy to clipboard, switch view to plain text mode
It works, But I'm interested, how to send value z without using QByteArray and QDataStream. If it is possible.
I think I have to use type casting, but how ? Type casting topic is not easy to understand for newbies:
http://www.cplusplus.com/doc/tutorial/typecasting/
Bookmarks