The main difference is the (default) debug configuration generates debug information for your program and disables compiler optimizations while the (default) release configuration enables compiler optimizations.
I say 'default' above because you can change the configurations as you see fit. For instance, you can make it so the debug configuration doesn't generate any debug info (doesn't make sense, but you can) and you can make it so the release configuration disables optimizations.
And also how to get both of them?
1) Switch to the debug configuration and build your program.
2) Switch to the release configuration and build your program.
The .exes will be in the output directory (Configuration Properties->General->Output Directory) specified in the project settings for the corresponding configuration.
The debug binaries (.exe) tend to be huge. However, if you crash something it can be easier to track by using a debug instance of visual studio. Also, you can run through your code bit by bit by hitting F5 (or is it F7) after you insert breakpoints in debug.
The release binaries are smaller as they don't have the debug information, however if you have a crash, you won't be able to gather as much information.
For example like, is that the .exe from debug/release can be run directly without the need of dll?
If you don't want to ship your .exe with the runtime dll, then the option is under Configuration Properties->C/C++->Code Generation->Runtime Library. Switch it to Multi-threaded as opposed to Multi-threaded DLL.
Also, $(SolutionDir)$(Configuration)\
I got this in Output Directory, what's does that means?
Say your .sln is at C:\projects\myproject\my.sln and say you're building with the Release configuration, then $(SolutionDir)\$(Configuration) would become C:\projects\myproject\Release. If you're building with the Debug configuration, then it would become C:\projects\myproject\Debug.
Thanks everyone, so, to create .exe, which one will be the best if I wanted to run ONLY .exe file in other computer without any other file? Release or Debug version? Thanks :)