[C programming] How to putchar( )

Veröffentlicht am: 07 November 2020
auf dem Kanal: Codelp 4041
477
9

The putchar( ) function is a basic one in C which prints a single character. In this video, we'll see how to write our own my_putchar( ) and what problems can happen.

For this, you'll need Linux (it's far more easier on Linux), GCC, Emacs, and the standard C library (which is given with GCC).

If you want to get the full directory with the programs we wrote in this video :
https://drive.google.com/drive/folder...

Why do we need my_putchar ?
My_putchar is a function. That means we can call it from every program which is compiled with. Also, with this function, we'll be able to write full words, numbers, \n ... It is the root of every 'print' function.

Commands to install gcc and emacs :
"sudo apt install emacs gcc" (Debian, Ubuntu)
"sudo dnf install emacs gcc" (Fedora, Red Hat)

To go further :
If you want more, you can try to write these functions too :
my_print_alpha_up : prints the alphabet in uppercase (you can try lowercase too : my_print_alpah_low)
my_print_ascii : prints the ASCII value of a character
my_print_digit : prints every digit from 0 to 9 (and more if you want)

Do not hesitate if you have any questions, to ask them in the comment section ! Me or the community will answer them with great pleasure !


Auf dieser Seite können Sie das Online-Video [C programming] How to putchar( ) mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Codelp 4041 07 November 2020 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 477 Mal angesehen und es wurde von 9 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!