0
#include "stdafx.h"
#include <iostream>

using namespace std;

int main()
{

cout << "Hello World!";
cin.get();
return 0;


}

Compiles and runs in dev cpp and notepad ++ but not in visual, Im trying to teach myself witht he internet but have no idea why this wont work.

1>------ Build started: Project: Hello world.cpp, Configuration: Debug Win32 ------
1>  Hello world.cpp.cpp
1>c:\users\david\documents\visual studio 2010\projects\hello world.cpp\hello world.cpp\hello world.cpp.cpp(9): error C2065: 'cout' : undeclared identifier
1>c:\users\david\documents\visual studio 2010\projects\hello world.cpp\hello world.cpp\hello world.cpp.cpp(10): error C2065: 'cin' : undeclared identifier
1>c:\users\david\documents\visual studio 2010\projects\hello world.cpp\hello world.cpp\hello world.cpp.cpp(10): error C2228: left of '.get' must have class/struct/union
1>          type is ''unknown-type''
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by SlzzyDzzy
0

What type of project did you select? Make a new project with Win32 Console as the type.

Don't select empty project, and you can uncheck Precompiled Headers.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.