// WECP100/book/writes.c 20240729
// description: write to stdout simple using system call, on LINUX
// machine: laptop window11
// os: linux using wsl on windows11
//> wsl >> Welcome to Ubuntu 22.04.2 LTS //on power shell
//$ cat /etc/os-release >> PRETTY_NAME="Ubuntu 22.04.2 LTS"
//$ uname -a >> inux LAPTOP-2E5CQCBT 6.6.36.3-microsoft-standard-WSL2 #1
// >> Sat Jun 29 07:01:04 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
// language: gcc --version >> gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
//$ gcc writes.c -o writes
//$ ./write >> Hello
#include< unistd.h> // for write
#include< stdio.h> // for perror
int main(){
int n = write(1, "Hello\n", 6); // // write to stdout(file descriptor:1)
// if (n < 0) { // handing error
// perror("write:"); //
// }
}
//--------------------------------------------------