Nope. The shifts are backwards. They must grow as the index shrinks. Also, don't use char, you may get weird semantics when the MSB is on. Use an unsigned type.
Thanks for the reply, I will try to apply that, I thought that it needed to be backwards because disch's tutorial was showing little-endian. So I should rather use "unsigned char" instead of just "char"? Huh, I didn't even know that was a thing until I just looked it up. Edit: Or I could just use uint8_t, as I'm not targeting those 12-bit machines. thanks again.
Was my first post's 4-byte code implementing little-endian by mistake, or just non-sense?
This is close, but not quite right. You are skipping over positions 24-31 and moving [0] to positions 32-39 (which don't exist in a 32-bit var, hence the warning).
Also, to reiterate what helios already said... don't use char. It's a signed type and therefore you might get weirdness when shifting into a larger variable type.