Get the latest tech news

Some sanity for C and C++ development on Windows


ullprogram.com/blog/2021/12/30/ A hard reality of C and C++ software development on Windows is that there has never been a good, native C or C++ standard library implementation for the platform. A standard library should abstract over the underlying host facilities in order to ease portable software development.

Before diving into the details, if you’re looking for a quick-and-easy solution for the Mingw-w64 toolchain, including w64devkit, which magically makes your C and C++ console programs behave well on Windows, I’ve put together a “library” named libwinsane. On unix-likes this doesn’t matter, but on Windows it means programs can’t read or write binary data on standard streams without calling a non-standard function. That incantation sets standard input and output in the C runtime to binary mode without the need to include a header, making it compact, simple, and self-contained.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Windows

Windows

Photo of development

development

Photo of sanity

sanity

Related news:

News photo

Writing GUI apps for Windows is painful

News photo

Fake IT support sites push malicious PowerShell scripts as Windows fixes

News photo

Game Pass Ad in Windows 11 Settings Sparks User Backlash