#include#include int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); int x = 10, y = 20; qDebug() << x << maybeSpace() << y; return a.exec(); }
10 20
#include#include int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); QString city = "New York"; double temperature = 23.5; qDebug() << "The current temperature in" << city << "is" << temperature << "degrees Celsius."; return a.exec(); }
The current temperature in "New York" is 23.5 degrees Celsius.In this example, maybeSpace is used to add space characters between the different parts of the log message for readability. Package library: Qt Core.