[edit]
From OP in comment to one of the solutions (explains more thoroughly):
"thanx for replying but i want to separate both bytes of uint16 and then the total 10 bytes which , i will get should be in array of uint8"
[/edit]
uint8 arr2[10] = {
0
};
uint8* ptr = (uint8 *) &arr1;
for
(
int
i=
0
; i<10; i++)
arr2[i] = *ptr;
ptr++;
MB_DATA data = {
2
,
3
,
20
,
90
,
3857
};
Should be noted that with this solution, the two methods of accessing the data are dependent, meaning you change something in one and it changes on both.... unions don't allocate memory independently for members.
Read the question carefully.
Understand that English isn't everyone's first language so be lenient of bad
spelling and grammar.
If a question is poorly phrased then either ask for clarification, ignore it, or
edit the question
and fix the problem. Insults are not welcome.
Don't tell someone to read the manual. Chances are they have and don't get it.
Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.