Sending data to slave arduino through I2C

Hey everyone. I am new to arduino and coding. Can someone help me with my doubt? I am recieving a hexadecimal data through my IR sensor on the master arduino. Now, i want to send this data to my slave arduino through I2C interface, so that the DC motor driver receives the data from the slave. How can I send this Hex data using I2c to slave? How can i define it as a single variable or integer and then send it? Please help me with the code.

You're more than likely receiving data from the sensor but I doubt it's hex data. Hexadecimal is a text representation of a number.

If you use e g. the IRremote library, you will have a variable of type long that holds the IR code and you can basically send that directly over the line.

On a cell phone at the moment so can't work out an example.

PS
Post your code for the IR receiver that you currently use.

#include <Wire.h>

#include <IRremote.h>
int receiver_pin = 2;
int slaveAddress = 4;

IRrecv receiver(receiver_pin); //Arduino will take output of IR receiver from pin 2
decode_results output;

void setup() {// Start the I2C Bus as Master
Wire.begin();
Serial.begin(9600);
receiver.enableIRIn();
}
// Start to take the output from IR receiver
void loop()
{
if (receiver.decode(&output)) {
unsigned int value = output.value;

Wire.beginTransmission(slaveAddress); // transmit to device #4
Wire.write("heloo there!");
Wire.write(value); // sends x

Wire.endTransmission(); // stop transmitting

delay(200);
}}