R
ruroma
Hello,
I need some help with the following:
1) I need to split a 16bit INT into two 8bit characters, and then be
able to join these two characters to form again the original 16bit
integer.
For example with values expressed in binary:
int n= 000000001111111;
--> char a=00000000;
--> char b=11111111;
and then be able to join a and b to form back n.
2) And last, I need to convert an integer into a string.
For example,
int n=3.142 ---> char string[5] = ['3','.','1','4','2']
Thank you very much!! I've tried working with casting but as far as I
know they don't seem to be the answer. I've also searched numerous
tutorials and web pages, but nothing productive. Any help or
suggestion will be highly appreciated. Thank you very much!!
I need some help with the following:
1) I need to split a 16bit INT into two 8bit characters, and then be
able to join these two characters to form again the original 16bit
integer.
For example with values expressed in binary:
int n= 000000001111111;
--> char a=00000000;
--> char b=11111111;
and then be able to join a and b to form back n.
2) And last, I need to convert an integer into a string.
For example,
int n=3.142 ---> char string[5] = ['3','.','1','4','2']
Thank you very much!! I've tried working with casting but as far as I
know they don't seem to be the answer. I've also searched numerous
tutorials and web pages, but nothing productive. Any help or
suggestion will be highly appreciated. Thank you very much!!