[C programming] How to putchar( )

Pubblicato il: 07 novembre 2020
sul canale di: 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 !


In questa pagina del sito puoi guardare il video online [C programming] How to putchar( ) della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Codelp 4041 07 novembre 2020, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 477 volte e gli è piaciuto 9 spettatori. Buona visione!