It doesn't matter what OS you are on, the C or C++ standard library will work just the same for programs that read and write files, including stdin and stdout.
bruce@i9:~/programs$ cat hello.cpp
#include <iostream>
int main() {
std::cout << "Hello World!" << std::endl;
return 0;
}
bruce@i9:~/programs$ g++ hello.cpp -o hello
bruce@i9:~/programs$ ./hello
Hello World!
bruce@i9:~/programs$
That happens to be on Ubuntu on Windows 11, but it will work exactly the same on native Linux (obviously), or MacOS or Linux on Arm or RISC-V etc etc.
bruce@i9:~/programs$ scp hello.cpp lp:
hello.cpp 100% 96 8.6KB/s 00:00
bruce@i9:~/programs$ ssh lp
____ _ ____ ____ _ __ ____ _ _
| _ \ _ _ _ _(_) ___|| _ \| |/ / / ___|(_)_ __ ___ ___ __| |
| |_) | | | | | | | \___ \| | | | ' / \___ \| | '_ \ / _ \/ _ \/ _` |
| _ <| |_| | |_| | |___) | |_| | . \ ___) | | |_) | __/ __/ (_| |
|_| \_\\__,_|\__, |_|____/|____/|_|\_\ |____/|_| .__/ \___|\___|\__,_|
|___/ |_|
-- Presented by ISCAS and Sipeed
Debian GNU/Linux 12 (bookworm) (kernel 5.10.113-lpi4a)
Linux lpi4a 5.10.113-lpi4a #2024.01.01.02.29+2bd2eac4a SMP PREEMPT Mon Jan 1 02:30:07 UTC 2 riscv64
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Fri Aug 23 16:47:25 2024 from 192.168.1.169
debian@lpi4a:~$ g++ hello.cpp -o hello
debian@lpi4a:~$ ./hello
Hello World!
debian@lpi4a:~$ file hello
hello: ELF 64-bit LSB pie executable, UCB RISC-V, RVC, double-float ABI, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-riscv64-lp64d.so.1, BuildID[sha1]=a16873f88fc47464ae68d2b28df89f7b10b39437, for GNU/Linux 4.15.0, not stripped
debian@lpi4a:~$