well a int is 4 bytes long in 32bit architecture and 8 bytes in 64bit architecture so what you should do it instead of using int is try using "unsigned char". and cast the result of qrand to "unsigned char"
Qt Code:
unsigned char n; n = (unsigned char) qrand() % 255;To copy to clipboard, switch view to plain text mode
Bookmarks