I prefer this approach - entirely with pointers and casting. This lets the compiler do all the work and removes the need for byte copying. It will work no matter what the size of set or int.
This will always put the int value at the end of the BYTE array. Reading back is just the inverse.
To be completely robust there should be a check that set is large enough for an int.
typedef unsigned char BYTE;
BYTE set[6] = { 0x15, 0x12, 0x84, 0x03, 0x00, 0x00 };
int inValue = 900;
* ((int *) (set + (sizeof(set) - sizeof(int)))) = inValue;
int outValue = * ((int *) (set + (sizeof(set) - sizeof(int))));
In reply to additional question:
BYTE set[16]={0xC7,0x80,0xEA,0x04,0x00,0x00,0xB0,0x04,0x00,0x00,0x8B,0xE5,0x5D,0xC2,0x08,0x00 };
* ((int *) (set + 5)) = inValue;
int outValue = * ((int *) (set + 5));
Read up on pointers. Also if you run this code in a debugger you can verify that it works.