What VS 2010 Template to Chose?
I am just getting started with C++ and wanted to know does it really matter what template you chose in开发者_运维问答 Visual Studio 2010 (for creating executables)? Like if I was creating a console application there is CLR Console Application, Win32 Console Application, and Win32 Project (description says it can be an application or a dll), what would I chose (or could i select Empty Project)?
If you are learning the C++ language itself, you probably want just a console based application. It means basically that you will have a black window that pops up and you can use things like std::cout to output to standard output and std::cin to get input from that console as well.
You probably do not want the CLR console based application because that is for C++ / CLI which is a different language from what C++ is.
Likewise you could use Win32 or MFC as well but that's meant mostly for GUI applications or applications that you don't want a black window popping up.
Yes, it matters what you choose.
"Console" applications are for writing applications which print to the screen and take input, but don't produce any graphical widgets.
"CLR Console" is for Managed C++. If you don't know what it is, don't try it yet.
"Win32" is for graphical applications or applications without a console window.
When I'm doing my C++ homework (or working out of a C++ in 24 Hours style of book), I use an empty project and manually add .cpp and .h files to the project.
精彩评论