Apologies if this has been asked before but I could not find any answers. If someone can enlighten me what is going on here?

I was playing around with Qt and standard c++. So the payground code below didn't do what I expected. Is that related QCoreApplication queue? I expected the sequence of **1 2 3 4 5** before **array size is: 5** and as the first operation executed?

Thank you for the help.

```
#include <QCoreApplication>
#include <QDebug>
#include <iostream>
#include <algorithm>
#include <array>

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);

    qDebug() << "hello";

    std::array<int, 5> vals {1,2,3,4,5};
    for (auto& v: vals) {
        qInfo() << v;
    }

    auto* vals_ptr = vals.data();
    qInfo() << *(vals_ptr+1);
    qInfo() << *(vals_ptr+2);

    auto print = [](const int& n) { std::cout << " " << n; };
    std::for_each(vals.cbegin(), vals.cend(), print);
    qInfo() << "array size is: " << vals.size();

    return a.exec();
}

```

Output below

```
 1 2 3 4 5hello
1
2
3
4
5
2
3
array size is:  5

```