:

Is it possible to convert the Uint to character form?

Added by: ~Nick, 2011 I 19

Added by: ~Nick, 2011 I 19

I would like to use char() function to convert Uint to character form.
But it is not supported.
Do I get other ways to convert it?

I will output a ascii number which included in ASCII table.

Added by: tomek, 2011 I 19

#include <ttmath/ttmath.h>
#include <iostream>

int main()
{
size_t i;
ttmath::UInt<2> a;
std::string str_result;

a = 123456;
a *= 56789;

std::cout << "result: " << a << std::endl;

a.ToString(str_result);

for(i=0 ; i<str_result.size() ; ++i)
std::cout << str_result[i] << ", ascii: " << int(str_result[i]) << std::endl;
}

Added by: ~Nick, 2011 I 19

Is it possible to change ascii code back to character form?
for example 65 -> a

Added by: ~Neo, 2011 I 20

this is the same
int a = 65;
cout << (char)a;