and as you can see I have the numbers 0x32,0x36 =26 and 0x39,0x31=91
I want to be able reverse the order and them put them in the old array or even create a new FIX array.
so it will be
you are right - it doesn't . it just a Hex value to be more easy to understand an explain the question.
no , this is just an example . I don't know what the number in the array will be .
but I do know that I am looking for 0x30-->0x39
and before the number I will have 0x20
also it could be more then 2 digits in a raw
for example I could have in the array :
.....0x38 0x33 0x39.....
when you look at the Hex-Ascii code tale you get this :
HEX Ascii
32 2
36 6
39 9
so when I have 0x36,0x39 --> that mean I have the number 39
if it easy for you ignore the ASCII value - this is just so it will be clear to see in the monitor - ignore it.
let me rewrite the question:
in this sequence of bytes, there are groups of bytes starting with 0x20, followed by a series of digits in ASCII (0x30 to 0x39). In each of these groups, I want to reverse the order of the digits
in this sequence of bytes, there are groups of bytes starting with 0x20, followed by a series of digits in ASCII (0x30 to 0x39). In each of these groups, I want to reverse the order of the digits
is it more clear now?
Getting there.
I assume that instead of "a series of digits in ASCII" you really mean "a serial of bytes whose value happens to be the ASCII value for the characters '0' through '9'"? Note that this information is totally irrelevant to the task at hand.
Next questions: what terminates this "series of bytes"? A certain number of bytes? The next occurrence of a 0x20 byte? What happens if you hit the end of the array before said termination?
I hope by now you see the importance of writing a clear, concise problem statement. If any of the engineers who work for me consistently wrote like that, they might not be working for me much longer.
I know the final number of the array I'm running the code on if this what you mean .
the final byte of the array is 0x03.
and the stat of the array is 0x02
when I wrote the question it's seem very logic and clear what I want to do
I will try to explain next time more
this is what I have so far :
finding the numbers and finding where are they located in the array
Serial.println("Place , value in HEX");
for (int i = 0; i < sizeof(FinalMsg); i++)
{
int nu = (FinalMsg[i]);
if (( 48 <= nu) && (nu <= 57))///48 its the DEC value of 0x30 , and 57 it's the DEC value of 0x39
{
numbersPlace[numbersPlaceInt] = i;
numbersPlaceInt++;
Serial.print(i);
Serial.print(" ");
Serial.print(nu, HEX );
Serial.println("");
}
else
{
//do nothing
}
}
and this is the result I'm getting:
Place , value in HEX
78 32
79 36
107 39
108 31
is this good place to start? ow can I continue from here ?
where do I see the values you are looking for ?
meaning , where is the 0-9 "search"?
let say some day I would like to reverse another sets of values
for example :
all the values that are (in HEX - 0x40--0x5A , which is A-Z )
how do I do it ?
so if it has ABCD -->it will change it to DCBA?