#include <QString>
#include <QTextStream>
//#include <QChar>

int main() {
    QTextStream cout(stdout);
    char array1[34] = "This is a dreaded C array of char";
    char array2[] = "if not for main, we could avoid it entirely.";
    char* charp = array1; /* pointer to first element of array */
    QString qstring = "This is a unicode QString. Much preferred." ;
    Q_ASSERT (sizeof(i) == sizeof(int));
    cout << "  c type sizes: \n";
    cout << "sizeof(char) = " << sizeof(char) << '\n';
    cout << "sizeof(wchar_t) = " << sizeof(wchar_t) << '\n';
    cout << "sizeof(int) = " << sizeof(int) << '\n';
    cout << "sizeof(long) = " << sizeof(long) << '\n';
    cout << "sizeof(float) = " << sizeof(float) << '\n';
    cout << "sizeof(double) = " << sizeof(double) << '\n';
    cout << "sizeof(double*) = " << sizeof(double*) << '\n';
    cout << "sizeof(array1) = " << sizeof(array1) << '\n';
    cout << "sizeof(array2) = " << sizeof(array2) << '\n';
    cout << "sizeof(char*) = " << sizeof(charp) << endl;
    cout << "  qt type sizes: \n";  
    cout << "sizeof(qstring) = " << sizeof(qstring) << endl;
    cout << "sizeof(qint32) = " << sizeof (qint32) << "\n"; /* guaranteed
        to be 32 bits on all platforms */
    cout << "sizeof(qint64) = " << sizeof(qint64) << '\n'; /* guaranteed to
        be 64 bits on all platforms */
    cout << "sizeof(qchar) = " << sizeof (QChar) << endl;  /* twice as big
       as a char */
    cout << "qstring.length() = " << qstring.length() << endl; /* for # of
        bytes, be sure to take into account the size of QChar */
    return 0;
}
/*OUT
  c type sizes: 
sizeof(char) = 1
sizeof(wchar_t) = 4
sizeof(int) = 4
sizeof(long) = 4
sizeof(float) = 4
sizeof(double) = 8
sizeof(double*) = 4
sizeof(array1) = 34
sizeof(array2) = 45
sizeof(char*) = 4
  qt type sizes: 
sizeof(qstring) = 4
sizeof(qint32) = 4
sizeof(qint64) = 8
sizeof(qchar) = 2
qstring.length() = 42
*/
