specifier for binary integer
#1

%d is for decimal integer
%f is for float
%s is for string
%x is for hexadecimal integer( i think)
what is for binary (unsigned) integer?
need this for printf
Thank you in advance!
Reply
#2

Код:
%b 	Inserts a number at this position in binary radix
%c 	Inserts a single character.
%d 	Inserts an integer (whole) number
%f 	Inserts a floating point number.
%i 	Inserts an integer.
%s 	Inserts a string.
%x 	Inserts a number in hexadecimal notation.
%% 	Inserts the literal '%'
I got this off Wikipedia. I just wanted to show you how easy it is when you do a bit of research.
printf
Reply
#3

You forgot about %c for char. Also - hex is not integer, it's simply hex.

How do you store the binary? Or do you want to represent integer as binary string? If yes, you have to create your own function which returns string. It's not hard if you know how to calculate decimal to binary (protip: it has to do with % operator).

@up:

didn't know that
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)