Output string with QTextStream : QTextStream « Qt « C++






Output string with QTextStream

  

#include <QTextStream>
#include <QString>

int main() {
    const char* charstr = "this is one very long string";
    QTextStream cout(stdout);  
    QString str = charstr; 
    cout << str << endl;
    cout << "\nA\tb\\c\'d\"" << endl;
    return 0;
}

   
    
  








Related examples in the same category

1.Using QTextStream to read a text file
2.Read text file QTextStream
3.Read QTextStream line by line
4.Create stream from file