-2

I'm writing my first program and its not working. I'm using Microsoft visual studio community and I made a console application project. I'm reading Programming prinicples and practice using c++ and I wrote exactly what it says. why isn't it working?

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
using namespace std;
inline void keep_window_open() { char ch; cin >> ch; }


int main()
{
    cout << "Hell, World!\n";
    keep_window_open();
    return 0;
}
H. Wang
  • 11
  • 2

1 Answers1

3

As from you comments clarification:

unexpected end of file while looking for precompiled header.
Did you forget to add #include "stdafx.h" to your source? 

Your project properties claim for Precompiled Headers (maybe it's the default for newly created projects, can't remember exactly).

So just following the advice from the error message and including

#include "stdafx.h"

at the first line of your .cpp file should fix the error.

πάντα ῥεῖ
  • 1
  • 13
  • 116
  • 190