Is there a way to store binary code in memory (as a value) then execute it?

For instance if I have an array of bytes I have filled with the binary code of say, a .exe, is it possible to execute it?

I dont know how to get binary code from memory or anything but I do have code that can extract a binary from resources if that helps..