Integer to bcd converter




















Find centralized, trusted content and collaborate around the technologies you use most. Connect and share knowledge within a single location that is structured and easy to search. I want to convert the integer whose maximum value can reach to in to BCD and store in to array of 4 characters. Here 0x00 0x01 0x23 0x45 stored in BCD format. I tried in the below manner but didnt work. In addition I suspect that i gets negative.

They are a bad smell. It does not give you a traditional string with digits in it. You proceed to try to read 8 of them. I doubt this is doing what you want it to do. If you want to print out a number into a string, you will have to run actual code, not just reinterpret bits in memory. If you really want it to be in a char array I'll do something like following code, I find useful to still leave the result in a little endian format so I can just cast it to an int for printing out, however that is not strictly necessary:.

Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Presales info. Follow us on Twitter Youtube. Rate 0. Suggestion To thank Quote Answer. Hi Blue. Don't panic. Do a quick test Place the integer number 10 INT 10 in there. What do you get? The in-software help does have some good extra information.

Queries to count numbers from a range which does not contain digit K in their decimal or octal representation. Article Contributed By :. Easy Normal Medium Hard Expert. Writing code in comment? Please use ide. Load Comments. What's New. Most popular in Bit Magic. Most visited in Mathematical. We use cookies to ensure you have the best browsing experience on our website.

Start Your Coding Journey Now! Login Register.



0コメント

  • 1000 / 1000