thesimplezero / demo-printf

Demo repo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The parser() function takes a format string, a list of conversion functions, and a list of arguments. It identifies conversion specifiers in the format string, calling the appropriate function to print the corresponding argument. If a specifier is not recognized, it prints the character following the % symbol. Concepts: format strings, conversion specifiers, function calls, string manipulation, control flow.

The print_char() function takes a character as an argument and prints it to standard output. Concepts: character data type, standard output, function calls.

The print_string() function takes a string as an argument and prints it to standard output. Concepts: string data type, standard output, function calls.

The print_percent() function prints a percent symbol to standard output. Concepts: character data type, standard output, function calls.

The print_integer() function takes an integer as an argument and prints it to standard output. Concepts: integer data type, standard output, function calls.

The unsigned_integer() function takes an unsigned integer as an argument and prints it to standard output. Concepts: unsigned integer data type, standard output, function calls.

The print_binary() function takes an unsigned integer as an argument, converts it to binary, and prints it to standard output. Concepts: binary number system, unsigned integer data type, standard output, function calls.

The print_octal() function takes an unsigned integer as an argument, converts it to octal, and prints it to standard output. Concepts: octal number system, unsigned integer data type, standard output, function calls.

The print_hex() function takes an unsigned integer as an argument, converts it to hexadecimal in lowercase, and prints it to standard output. Concepts: hexadecimal number system, unsigned integer data type, standard output, function calls.

The print_heX() function takes an unsigned integer as an argument, converts it to hexadecimal in uppercase, and prints it to standard output. Concepts: hexadecimal number system, unsigned integer data type, standard output, function calls.

The hex_check() function takes an integer as an argument and returns its corresponding hexadecimal character. Concepts: hexadecimal number system, integer data type, function calls.

The rev_string() function takes a string as an argument and reverses it in place. Concepts: string data type, string manipulation, function calls.

The write_base() function sends a sequence of characters to be written to standard output. Concepts: standard output, string manipulation, function calls.

The base_len() function takes a number and a base as arguments and returns the number of digits needed to represent the number in that base. Concepts: integer data type, number systems, function calls.

The _memcpy() function takes a source memory address, a destination memory address, and a number of bytes to copy and copies the specified number of bytes from the source to the destination. Concepts: memory, memory manipulation, function calls.

The print_number() function takes an integer as an argument, determines its sign, and prints it to standard output. Concepts: integer data type, standard output, function calls.

The print_unsgined_number() function takes an unsigned integer as an argument and prints it to standard output. Concepts: unsigned integer data type, standard output, function calls.

The print_reversed() function takes a string as an argument, reverses its order, and prints it to standard output. Concepts: string data type, string manipulation, standard output, function calls.

The rot13() function converts a string passed as an argument to ROT13 encryption. Concepts: the concept of encryption, specifically the ROT13 encryption algorithm. It involves shifting each letter in a string by 13 positions in the alphabet, wrapping around if necessary, to produce a new string that is unreadable without the key. The concept of string manipulation and iteration is also involved in the implementation of the rot13 function.

Input: A string S

┌───┐ │ S │ └───┘ | V ┌─────────┐ │ Loop to │ │ iterate │ │ through │ │ each │ │ char in │ │ S │ └─────────┘ | V ┌──────────┐ │ Check │ │ if the │ │ char │ │ is a │ │ letter │ └──────────┘ | V ┌───────┐ │ Apply │ │ the │ │ ROT13 │ │ cipher│ └───────┘ | V ┌────────────┐ │Add char │ │to new S │ └────────────┘ | V ┌───────┐ │Repeat │ │until │ │ end │ │ of │ │ S │ └───────┘ | V ┌─────────┐ │ Output │ │ the │ │ new S │ └─────────┘

About

Demo repo


Languages

Language:C 79.4%Language:Shell 20.6%