Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
I see that sizeof returns 8 for a QString:
QString s; s = "012345678901234567890123456789"; qDebug() << sizeof(s);
How much more memory is taken up by the characters, is it 1 byte per character?
Hi,
sizeof return the size of an object:
qDebug() << sizeof(QString); // -> 8
A QString is composed of 16 bits unicode characters. Hence the size in memory is equal to:
2*s.size() or sizeof(QChar)*s.size();
@Guerrian out of curiosity, are you only interested in the space taken by the chars or the complete data structure that is QString ?