LoopFor

#include <QCoreApplication>
#include <iostream>
#include <string>
using namespace std;

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);

    string str ("Hello!");
    for (char c : str)
    {
        std::cout << "[" << c <<"]";
    }
    std::cout <<'\n';

    return a.exec();
}