C++ (Qt)#include <iostream>#include <QDir>#include <QStringList>#include <QDebug> int main(){ QDir dir( QString( "./" ) ); QStringList list = dir.entryList(); foreach (QString s, list) { qDebug() << s; std::cout << s.toStdString() << std::endl; }}
C++ (Qt) #include <iostream>#include <QDir>#include <QStringList>#include <QDebug> int main(){ QDir dir( QString( "./" ) ); QStringList list = dir.entryList( QDir::NoDotAndDotDot | QDir::Dirs ); foreach (QString s, list) { qDebug() << s; std::cout << s.toStdString() << std::endl; }}
std::cout << "String 1"; fprintf(stderr, "String 2"); fflush(stderr); std::cout << std::flush;
C++ (Qt) #include <iostream>#include <QDir>#include <QStringList>#include <QDebug> int main(){ QDir dir( QString( "./" ) ); QStringList list = dir.entryList( ); // QDir::NoDotAndDotDot | QDir::Dirs foreach (QString s, list) { qDebug() << s; fflush(stderr); std::cout << s.toStdString() << std::endl; std::cout.flush(); }}