25
Oct
Binary decimal conversion….
Related Blog Items
- Binary to decimal
- IEEE 754 Binary Floating Point Representation
- ASCII Case Conversion
- Little, big endianess explained -- part2
- Convert integer to binary string
Here is a program to convert a binary string to decimal number.
ex. "0101" to 05
Parameters:
binary: is binary string
size: is size of the binary string buffer
int bin2dec(unsigned char *binary, int size) { int i, result = 0; for(i = 0; i < size; i ++) { result += (binary[i] - '0') << (size - i - 1); } return result; }
any comments welcome…
Popularity: 17%
You need to log on to convert this article into PDF
Related Blog Items - Binary to decimal
- IEEE 754 Binary Floating Point Representation
- ASCII Case Conversion
- Little, big endianess explained -- part2
- Convert integer to binary string
Related Blog Items
- Binary to decimal
- IEEE 754 Binary Floating Point Representation
- ASCII Case Conversion
- Little, big endianess explained -- part2
- Convert integer to binary string
No Comments
No comments yet.