Created
November 1, 2017 20:14
-
-
Save nathan-osman/f8b4fc2dae17c4de5c25574e7ba13d14 to your computer and use it in GitHub Desktop.
Write to STDOUT using QFile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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