Hello all. I'm trying to display the quotient and remainder (which have been converted to ASCII) from a multiplication. How can I combine them to be displayed together/stored in the same variable (as ASCII)?
Posted on 2009-03-01 18:14:11 by danwoods
That highly depends on OS (DOS, Windows, etc...) and other factors.

Generally, a conversion to ASCII warrants the use of strings. You would want to store the ASCII data linearly in a string and then print out that string.

You can dynamically allocate space for the string (safer), or use a fixed byte buffer of a sufficient size (quicker). It really depends on the situation at hand.

Any attempt to re-manipulate the ASCII result would require conversion back to binary (messy/inefficient), or reuse of the original data, as opposed to the notion of a "variable" to store the ASCII result... which would take more room as well.

More often than not, and unless you have a really specific need to do otherwise, I would recommend simply keeping track of your binary data/variables and print them out as needed, printf style.
Posted on 2009-03-02 14:25:05 by SpooK