I'm trying to write a program to open a games .exe file but I dont know what function or how to do it thanks in advance.
I'm not quite sure what you mean, but i'll take a guess and say that you're looking to read/write to/from an exe file.
Rather than go through the steps involved in doing this using C++ code, I'd first like to clarify your reasons for doing it. Are you looking to write a patcher? Or do you think that "opening the file" is going to give you some form of human readable information that you can then "adjust" to make changes to that exe?
If you mean the former, then you need to do some reading on file I/O (of which there are numerous tutorials on the internet, and probably on this site too!), using binary mode instead of text mode.
If you mean the latter, then you're going to be disappointed, because EXE files aren't really human readable (unless of course you're an ASM coder ).
Hope that helps.
No all im trying to do is open the .exe file so i can play the game. A sort of shortcut type of thing to open the game
Right, so you mean you want to run the exe. Try to be a little more specific next time you post
The dirtiest way is to use system(), but there are other options such as ShellExecute() that are part of the Windows API.