Qt type size : QString « Qt « C++






Qt type size

  

#include <QString>
#include <QTextStream>


int main() {
    QTextStream cout(stdout);
    char* charp = array1;
    QString qstring = "This is a unicode QString." ;
    Q_ASSERT (sizeof(i) == sizeof(int));
    cout << "  c type sizes: \n";
    cout << "  qt type sizes: \n";  
    cout << "sizeof(qstring) = " << sizeof(qstring) << endl;
    cout << "sizeof(qint32) = " << sizeof (qint32) << "\n"; 
    cout << "sizeof(qint64) = " << sizeof(qint64) << '\n'; 
    cout << "sizeof(qchar) = " << sizeof (QChar) << endl;  
    cout << "qstring.length() = " << qstring.length() << endl; 
    return 0;
}

   
    
  








Related examples in the same category

1.Complete demo for QString
2.Using QString as the parameter
3.Format command line parameter with QString
4.extends QString
5.cpp with qstring