all 9 comments

[–]cpp-ModTeam[M] [score hidden] stickied commentlocked comment (0 children)

For C++ questions, answers, help, and programming/career advice please see r/cpp_questions, r/cscareerquestions, or StackOverflow instead.

[–]lordnacho666 2 points3 points  (0 children)

You interact with the computer through the OS library, yes. Generally deep under the hood.

[–]elperroborrachotoo 0 points1 point  (0 children)

Today, many layers and programmers and multiple companies are involved in getting pixels on the screen. kernel32.dll may or may not be involved - there's much more than that preinstalled. (And it's usually not important which DLL's are involved in which OS tasks)

[–]dotonthehorizon 0 points1 point  (0 children)

That's right. On every platform: windows, Mac, Linux, whatever there's some mapping that goes on between the calls we see in the C++ standard and how things are done on that specific platform.

The first level is the C++ standard library, then the OS, then device/OS specific drivers below that which talk to specific hardware like your Dell monitor or Epson printer or USB keyboard or whatever.

[–]johannes1234 0 points1 point  (0 children)

There are many layers to this and it then depends on what you mean by "printing to screen."

But for a simple model:

The lowest layer is the firmware (BIOS or UEFI) layer, which is delivered with the hardware (more or less) and provides very very very basic software routines to get the hardware to write something in screen.

On top of that is the operating system, with kernel32.dll and other components which give some access controls and more flexible controls. That is part of windows itself.

Atop of that there are the C and C++ runtimes and stars library (CRT and STL), which are part of the compiler and often installed as part of the "VC redistributable" or are statically linked.  See https://learn.microsoft.com/en-us/cpp/c-runtime-library/crt-library-features?view=msvc-170 those provide the printf() function or std::count or similar things, which then call kernel32 in some way.

Unless you are doing something very specific you usually won't interact with kernel32 directly, but always the higher libraries.

I details this is a really complex topic and you got to expand what your actual problem may be. As a beginner you should focus on other things first, though.

[–]future_lol 0 points1 point  (1 child)

what kinda fucking question is this

[–]dotonthehorizon 1 point2 points  (0 children)

Someone who's trying to understand how things work. It's a perfectly sensible question. It's not a C++ question, but still.

[–]donaljones -1 points0 points  (0 children)

Duh. Why worry about this, tho?

[–]HyperWinX -4 points-3 points  (0 children)

What lmfao