Skip to content

Instantly share code, notes, and snippets.

@nathan-osman
Created November 1, 2017 20:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nathan-osman/f8b4fc2dae17c4de5c25574e7ba13d14 to your computer and use it in GitHub Desktop.
Save nathan-osman/f8b4fc2dae17c4de5c25574e7ba13d14 to your computer and use it in GitHub Desktop.
Write to STDOUT using QFile
cmake_minimum_required(VERSION 3.2.0 FATAL_ERROR)
project(stdout)
find_package(Qt5Core 5.4 REQUIRED)
add_executable(stdout main.cpp)
target_link_libraries(stdout Qt5::Core)
#include <cstdio>
#include <QFile>
int main(int argc, char **argv)
{
QFile f;
f.open(stdout, QIODevice::WriteOnly);
f.write("This is a test.");
f.close();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment