C++ lühikursus 3: Difference between revisions
From ICO wiki
Jump to navigationJump to search
New page: =Sissejuhatus= STDOUT QTextStream QFile =Faili kirjutamine= <source lang="cpp"> #include <QTextStream> #include <QFile> QFile data("kalasaba.txt"); if (data.open(QFile::WriteOnly))... |
No edit summary |
||
Line 1: | Line 1: | ||
[[Category:Robootika]] | |||
=Sissejuhatus= | =Sissejuhatus= | ||
Latest revision as of 09:37, 27 October 2011
Sissejuhatus
STDOUT QTextStream QFile
Faili kirjutamine
#include <QTextStream>
#include <QFile>
QFile data("kalasaba.txt");
if (data.open(QFile::WriteOnly)) {
QTextStream out(&data);
out << "See rida läheb faili!" << endl;
}
Standardväljundisse kirjutamine
#include <QTextStream>
#include <QFile>
QTextStream sout(stdout);
sout<<"See rida läheb standardväljundisse"<<endl;