Question
Write a function in C that takes a 64-bit number and converts it to an array of 8-bit numbers.
Answer
The lowest eight bytes can be simply copied in to the destination. A cast should be used to avoid a warning.
The 64-bit value can be shifted 8-bits for each loop to obtain the next value.
Background
This question was given during an interview on 1/17/2014 for a firmware test engineer position.