Skip to content

Simple test application that prints messages to the output using various methods, accompanying an article on my blog

Notifications You must be signed in to change notification settings

sawickiap/TextOutputTest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

TextOutputTest

A simple "Test" application that prints messages to the output using various methods:

  • Standard output, the C way: printf / wprintf
  • Standard output, the C++ way: std::cout, std::wcout
  • WinAPI console: WriteConsole(GetStdHandle(STD_OUTPUT_HANDLE), …
  • Standard error: fprintf(sderr, … / fwprintf(stderr, …
  • Debugger message: OutputDebugString

Plus a "Host" application that captures the output of a subprocess spawned using CreateProcess sent to standard output, standard error, and OutputDebugString.

Visual Studio 2022 project using C++20 language.

This code accompanies an article on my blog: "Ways to Print and Capture Text Output of a Process" @ asawicki.info

Published in July 2023. License: Public Domain.