Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Doubt in convert two 8 bit value into one 16 bit value

ktrsathishktrsathish Member Posts: 1
[b][red]This message was edited by ktrsathish at 2004-5-21 2:51:19[/red][/b][hr]
Hi,
I am having one doubt, i am putting here my doubt. Please give a solution to my doubt.

If two variables are there, one is unsigned char pointer varaible ch and another is 16 bit integer variable var. Suppose if i wants to store the unsigned character variable in 16 bit interger variable in little endian format.For example,

unsigned char *ch = {0x25,0x35};
unsigned int var;

Ans: var shoul contains 3525.

How to write a program. If possible to write in different way please mention all the possible. The code should be in C.

Thanks and regards,
Sathish


Sign In or Register to comment.