You don't want to use a char
array since char
may or may not be signed (implementation defined). If you are playing with hexadecimal numbers from 0x00 to 0xFF, I strongly recommend using an unsigned char
array.
Looks like the values in the array are sequential, from 0 to N. This indicates using a for
loop.
The array is a fixed size of 8 bytes. Hmmm, another good candidate for a for
loop.
The hard part of your task is the direction of the bytes. For example are filling in the array starting at position 7 or at position 0?
So here is some psuedo code to help you along:
For each value from 0 to N do:
begin
for array position from 0 to 7 do: // or from 7 to 0
put 'value' into the array at 'position';
call function to process the array.
end
For more fun, change the functionality of "put 'value'" to "put random value".
If you want us to actually write your program, let us know. I could use the extra money. :-)