   Setup for Visual Studio Project
  I am as new to visual studio as I am to game programming, but I do have some experience programming in a variety of languages.  So my question comes from my first attempt to write a C++ game in visual studio.I thought I should start small so I am going to do a couple of console games like guess the number, and guess the word, but when I go in to create the project I feel a little overwhelmed by all the options.When I finally chose the Win32 Console Project it opened up a window in which I pressed the Finish button and the project was created.  But I would like to know why my project already has a pre-compiled header called stdafx.h and a source file stdafx.cpp?  This might not be so off putting, but the main is not even in a format that I am familiar with.  I mean what is up with:// Word Guess.cpp : Defines the entry point for the console application.//#include "stdafx.h"int _tmain(int argc, _TCHAR* argv[]){return 0;}????I want to understand the the how and why, and not just expect that it is going to work.By the way, you will all be seeing a lot of me here on the site and I look forward to learning from and working with all of you.   
  Typically things preceeded by an underscore are compiler specific syntax.  _tmain is visual studios little happy main function.  Don't know why they did that, just did.  One possible, yet cynical, answer is that using compiler intrinsics locks your code to Visual Studio (you have to make an effort for it to sucessfully compile outside of their IDE).The purpose of the project setup wizard is to get you to a running application without you having to dig through windows manuals to remember the syntax for all the windows crap.  The idea of a wizard is click a couple of buttons and you get a guaranteed to run application framework into which you can just plug your code and run.Purists will create a blank project and author everything for themselves from scratch, or create their own wizard templates.Whether or not you use precompiled headers or pretty much anything else is usually a choice you can make through options in the wizard.-me   ;  There's a checkbox during project setup labeled "Empty Project." Check it next time.As to what the stdafx.cpp does, it provides a translation unit that is specially treated (it's a compiler extension, after all) to generate a single object file for all the translation units corresponding to the included headers. This means that those other translation units do not need to be recompiled on each build (this is why you shouldn't put frequently changing source file headers into stdafx.cpp), providing a speedup.Hope that helps.   ;  The stdafx stuff has to do with pre-compiled headers.  I must admit my own ignorance in how they work, but as I understand it, they help to reduce compile times in large projects.The reason you got all of that extra stuff is that Visual Studio gave you its template for a console project.  If you don't like all of that stuff, when you create the solution and give it a name, in the wizard thing that shows up after you've selected the name, click on Application Settings and then select "Console Application" and "Empty Project."  Then it will just set your compilation options to give you a console application.  It also won't give you anything else.   ;Quote:Original post by PalidineTypically things preceeded by an underscore are compiler specific syntax.  _tmain is visual studios little happy main function.  Don't know why they did that, just did.  One possible, yet cynical, answer is that using compiler intrinsics locks your code to Visual Studio (you have to make an effort for it to sucessfully compile outside of their IDE).It's not a compiler intrinsic; it's a preprocessor definition that expands to either wmain or main depending on if _UNICODE is defined. It's defined in tchar.h,  and is one of the many, many preprocessor definitions that MS uses for generic text mappings.   ;  Thank you all for the information, it has been of great help.   