Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/trustcoodes/printf
Team project (printf) ALX
https://github.com/trustcoodes/printf
Last synced: 7 days ago
JSON representation
Team project (printf) ALX
- Host: GitHub
- URL: https://github.com/trustcoodes/printf
- Owner: TrustCoodes
- Created: 2022-10-16T17:34:49.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2022-10-16T19:00:19.000Z (about 2 years ago)
- Last Synced: 2024-06-18T17:32:27.009Z (5 months ago)
- Language: C
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Software Enginering Printf Team Project
Synopsis
function _printf() writes output to stdout, the standard output stream with the format and options without making use of any of the standard library files
The prototype of this function is: int _printf(const char format), The format string is a character string starting and ending with double quotesThe field width
An optional decimal digit string (with nonzero first digit) specifying a minimum field width. If the converted value has fewer characters than the field width, it will be padded with spaces on the left if the flag - is not present, and on the right if it is present. A character * can be used instead of a decimal string. In this case, an argument passed to the function will be taken as the width value.
printf("%5d", num);
orprintf("%*d", width, num);
The precisionAn optional precision, in the form of a period ('.') followed by an optional decimal digit string. A negative precision is taken as if the precision were omitted. This gives the minimum number of digits to appear for d, i, o, u, x, and X conversions, or the maximum number of characters to be printed from a string for s and S conversions. A character * can be used instead of a decimal string. In this case, an argument passed to the function will be taken as the precision value.
printf("%.3d", num);
orprintf("%.*d", precision, num);