How to retrieve the first eight bits of a number

Hello,
I am working on a project where I need to retrieve the first 8 bits and last 8 bits of a number and store them in an array. Below is what I have so far but want to make sure that this is the best approach.
1
2
3
4
5
6
unsigned short num = 20000;
char value[10];

value[0] = (num & 0xFF);// first 8
value[1] = (num >> 8);// last 8


Any help will be greatly appreciated!!
Thanks In Advance!!!
Looks reasonable to me.
Topic archived. No new replies allowed.