print integer to stdout using write or putchar?
#include "my_putchar.h"
/* 0x2D = '-'
* 0x0 = NUL */
int my_put_nbr(int n)
{
if (n < 0)
{
my_putchar(0x2D);
n = -n;
}
if (n > 9)
{
my_put_nbr(n/10);
}
my_putchar((n%10) + '0');
return 0;
}
Also in C:
- qtableview get selected row
- c program to find number of days in a month using switch case
- incompatible implicit declaration of built-in function ‘exit’
- sinus c math.h
- c check if array is empty
- how to remove a node from a linked list in c
- how to free memory in c
- stack implementation
- two bytes to int c
- how to remove \n from a string c
- c strcmp
- i765 OPT filing fees october 2
- set timezone in debian terminal
- c read a whole string from a file
- what is conio.h
- Route::resource
- how to draw a graph or histogram in c language
- if statement in c
- docker-compose file break line
- how to input a string into a char array cpp
- atol c.
- execvp bad address
- c float to int
- c vs python