code for drive 74hc595

I'm developing a code to drive a 74hc595 but I do not have the same in hand, I tried to use a circuit simulator but I was not successful, I would like to have a look at the code and give me tips on how to improve, my goal was to create a function similar to digitalWrite (pin, state) to be able to independently drive the registers pins.

shiftWrite.ino (673 Bytes)

explaining what I wanted to do:
1- Create a function with two parameters (pin, state)
2- creates a byte that will contain the 8 bits (8pinos), starting with all 0
3-use the bitWrite function to modify a bit on this bit according to the parameters entered (which bit, which state)
4- uses the shiftOut function to write in the buffer the byte that has now had a modified bit.
Is there an error in the code?

byte value = B00000000;
  bitWrite(value,pin,state);

Will only ever be able to write a logic 1 to one pin. You need to be able to change a 1 or a 0 at any pin and leave the other pins the same.
For that your value variable needs to be either a global variable or a static variable.

please read How to use this forum to find out how to post code correctly.