Search
 
SCRIPT & CODE EXAMPLE
 

C

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;
}
Comment

PREVIOUS NEXT
Code Example
C :: hgggggggggggggggg 
C :: tytykjtuky 
C :: c enums 
C :: OpenDaylight maven settings 
C :: e sharm card jobkhozo.com 
C :: error: ‘_Atomic’ does not name a type 
C :: clipboard lib 
C :: buble sort in c that ask user input 
C :: Dynamic Memoray alocation For 2D 
C :: pebble scripting Boolean expression 
C :: c "hello world" 
C :: Algorithm that flips sentences and numbers 
C :: google sheets transpose new line to table 
C :: bullseye lxc network problem 
C :: write the data in perticulare memmory loaction in C 
C :: change no_turbo 
C :: anticonstitutionnellement 
C :: batteries included 
C :: inline function in c example 
C :: not repeated serial number in c 
C :: c pass two dimensional array to function 
C :: i2c scanner 
C :: unox reclame harmonica tabs 
Dart :: flutter elevated button radius 
Dart :: flutter padding top and bottom 
Dart :: order list dart 
Dart :: how to stop screen rotation in flutter 
Dart :: flutter substring 
Dart :: flutter getx snackbar 
Dart :: string to double fultter 
ADD CONTENT
Topic
Content
Source link
Name
8+7 =