Compiling an SD/MMC and fat16 library

How can i get an unsigned long int converted to it´s bytes?
I want to store the offset in the start range of the card, the first four bytes.
So this could be read the next time it starts recording and does not overwrite the record from before.

I thought code like this could help, but i googled extensively for a solution, but didn´t found something really helpful.
Here´s how i thought:

unsigned long int sdoffset=1024;  // r/w offset
// offset 0 to 1023 is for rw offset and whatever storage.
// for the first usage have to write zeroes to that.

void checkStartOffset(){
  byte offsetstored[4];
  sd_raw_read(0, offsetstored ,4);
  sdoffset=(unsigned long int)offsetstored;
  Serial.print("sdoffset read: ");
  Serial.println(sdoffset);
}
void WriteLastStartOffset(){
  char offsetstored[4];
  offsetstored=(byte)sdoffset;
  sd_raw_write(0, offsetstored ,4);
}

the start check compiles, but don´t know at the moment if that works. The read function will not compile.
Could someone point me into the right direction?

Thank you very much for any help with this!