   New to C++
  Hey all,I'm just starting to learn C++ out of a C++ for Dummies book.  I have Visual Studio 2003, and so I'm trying to use it for the builds of my project, but it is not working at all.  The book says that it is not teaching windows application building, so what kind of a project template should I use for their examples to work?  Here is the first sample in the book.#include <stdio.h>#include <iostream>int main(int nNumberofArgs, char* pszArgs[]){// enter the temperature in Celsiusint celsius;cout << "Enter the temperature in Celsius:";cin >> celsius;// Calculate the conversion factor for Celsius to Farenheitint factor;factor = 212 - 32;// Use conversion factor to convert Celsius into Farenheit valuesint fahrenheit;fahrenheit = factor * celsius/100 + 32;// Output the resultscout << "Fahrenheit value is:";cout << fahrenheit;return 0;}The first error that comes up when I build this is "fatal error C1010: unexpected end of file while looking for precompiled header directive".  Obviously, since this example is straight out of the book, I shouldn't need to edit code to get it to work.  I started it as a "Visual C++ Project...Win32...Win32 Console Project".  So what am I doing wrong?   
  Hey PricklyMustard,I haven't used Visual C++ since version 6, but I suspect there may be a "Use precompiled headers" option in either your IDE or more specifically your Project settings. Disable this and the problem should go away.What you're experiencing are the idiosyncrasies of the IDE. I'd recommend getting familiar with every aspect of your given IDE, and make sure you at least understand what features are present, even if they won't bear much significance to what you're doing right now.Have you taken a look at sites such as http://cprogramming.com/ or http://cplusplus.com/? These might help you along the way.;  In addition to the above poster, don't forget to put down this statement after #include <iostream>:using namespace std;and delete the first line:#include <stdio.h>That is a C header file, not needed for this simple program or for that matter any Cpp program.   ;  I feel your pain.  Here's exactly what you need to do.  Create a new project by following these steps:Open Visual C++ 2003 and close any projects that might be open.File->New->ProjectSelect "Win32 Console Project" and type a name for your project.DO NOT PRESS FINISH!Click Application Settings on the left-hand blue column.Check the "Empty project" box.Now press finish.In the solution explorer box, a treeview of your project, right-click the folder that says "Source Files".  If you don't see the solution explorer box, click View->Solution Explorer in the menu to bring it up.In the popup menu, click Add->Add New Item.Select "C++ File (.cpp)" and type a name for your file, like "myapp.cpp".Click Open.Copy and paste your code into the file.Before the "int main(..." line, type the following: (or cin and cout won't work)using namespace std;Now click Build->Build Solution in the main menu (usually F7 will do it).Click Debug->Start (usually F5 will do it).To run it without debugging it, Ctrl-F5 will do it.Man, I wish someone would've spelled some stuff out for me all that time ago :-)~BenDilts( void );   ;  When you created the new C++ console project it should have had the following code in the .cpp file it created:// CtoF.cpp : Defines the entry point for the console application.//#include "stdafx.h"int _tmain(int argc, _TCHAR* argv[]){ return 0;}I don't know how this IDE works but you need to leave that header there, not sure about the _tmain, but I would assume that it needs to remain the way it is also.So I took your code and pasted it in and added a line to get this:// CtoF.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include <stdio.h>#include <iostream>using namespace std;int _tmain(int argc, _TCHAR* argv[]){// enter the temperature in Celsiusint celsius;cout << "Enter the temperature in Celsius:";cin >> celsius;// Calculate the conversion factor for Celsius to Farenheitint factor;factor = 212 - 32;// Use conversion factor to convert Celsius into Farenheit valuesint fahrenheit;fahrenheit = factor * celsius/100 + 32;// Output the resultscout << "Fahrenheit value is:";cout << fahrenheit;return 0;}You have to add the "using namespace std;" line in there otherwise the cout's and cin's won't work, due to the newish namespace feature of C++.  After making the above changes the code ran.Not sure I like the VC++ IDE all that much... if you just started learning C++ you may want to look into a different IDE that doesn't do things for you, like add code.  At least it would be easier to learn I think, and you would have to worry about making the compiler happy with the extra includes and whatnot.And I second MatrixCubed's suggestion to check out http://www.cplusplus.com. It's a great resource.   ;  Great Posts everyone.  I'm also new to C++.  Your final code should look something like this:/ myapp.cpp : Defines the entry point for the console application.//#include <stdio.h>#include <iostream>#include "stdafx.h"using namespace std;int _tmain(int nNumberofArgs, char* pszArgs[]){// enter the temperature in Celsiusint celsius;cout << "Enter the temperature in Celsius:";cin >> celsius;// Calculate the conversion factor for Celsius to Farenheitint factor;factor = 212 - 32;// Use conversion factor to convert Celsius into Farenheit valuesint fahrenheit;fahrenheit = factor * celsius/100 + 32;// Output the resultscout << "Fahrenheit value is:";cout << fahrenheit;return 0;};  You only need to use the "_tmain" BS if you're writing a .NET app, and A) You're not, B) C++ isn't a good language for .NETAll you need to do is create a console app, specify that you want the project to be empty, and create a .cpp file   ;  First of all, screw .Net (for now). When you start visual studio, click visual C++ and then choose win32 console (or app) and choose 'empty project'.   ;  Wow, thanks for all the great responses!  Well, the code now compiles and builds successfully, and I can run the program in a console... I do have another problem though.  It seems that it is exiting right after I input the first value, so I don't ever see the result.  How would I add a "Push any key to exit" feature (or something that would work similarly)?   ;  One (old) way is to do this:system("pause");~BenDilts( void );   