Hi All,
I was wondering if there is a shortcut to find the binary equivalent of any
number in C without having to use array etc. I came across an
interesting tweak with "itoa" function.
Let us see how.

*char binary_string[10];*
*unsigned short int number = 8;*

and then apply itoa with a radix argument of 2.
like:

*itoa(number,binary_string,2);*
*printf("\n %s ",binary_string);*

Isn't it interesting ?

Amar Akshat

-- 
Research Associate,
MIT-LEACH Simulation.

*Still in the,*
Dept. Of Computer Engineering,
Sikkim Manipal Institute Of Tech

Phone # : +919932389841
www.ramaprasad.info
www.geocities.com/algeekoders.



"Where You See a Feature I See a Flaw.."
_______________________________________________
ilugd mailinglist -- ilugd@lists.linux-delhi.org
http://frodo.hserus.net/mailman/listinfo/ilugd
Archives at: http://news.gmane.org/gmane.user-groups.linux.delhi 
http://www.mail-archive.com/ilugd@lists.linux-delhi.org/

Reply via email to