Hello, I have been googling c++ game codes, to examine and test, however, once I copy and paste into visualstudio, none of them work. I thought perhaps it was just a bad code, but I have tried several and none of them work. Any reasons for this?
Basically no projects expect you to copy-paste the source code into a compiler. Follow the instructions -- that is, read any attached READMEs and follow the directions there.
If there are no directions, you probably shouldn't expect the code to work without significant effort on your part (and probably shouldn't study it!)