[c++] How to use Visual Studio C++ Compiler?

I recently installed Visual Studio 2013. I can create a new project (Visual C++), but the error I have to come across is that I cannot run the app. Here is the code that I'm trying to run on Visual Studio 2013.

#include <iostream>
using namespace std;

int main() {
    cout << "Hello World";
    return 0;
}

I am sure this code would run, and will output hello world, but in Visual Studio it gives me issues, saying:

Values cannot be null,
Parameter name: solutionDirectory.

What am I missing here?

Here is an image for this:

enter image description here

This question is related to c++ visual-studio-2013

The answer is


You may be forgetting something. Before #include <iostream>, write #include <stdafx.h> and maybe that will help. Then, when you are done writing, click test, than click output from build, then when it is done processing/compiling, press Ctrl+F5 to open the Command Prompt and it should have the output and "press any key to continue."