I have always used Linux Text Editor for C/C++ coding. I'm totally new to Visual Studio. I downloaded Visual Studio 2013 and wrote a very basic code. Before I tell you my problem, I think I should mention how I opened the new project so that it's not the matter of opening a wrong new project!
So here it is:
File > New > Project > Visual C++ > Win32 Console Application > ok > (Window appears saying "Welcome to Win32 Application wizard") > Next > checked the box saying "Empty Project" under Additional options > Finish
So then, I just right click on the "Source Files" > Add > New Item > C++ File(.cpp) > Add
Then my desired window appears so that I can write some code that should work!!
I wrote the following (very basic code) in Visual Studio 2013:
#include <iostream>
using namespace std;
int main()
{
cout << "What's your name?";
string name;
cin >> name;
cout << "Enter your age: ";
int age;
cin >> age;
cout << "In a decade, you will be " << age + 10 << "years old!" << endl;
return 0;
}
To run it, when I press "Local Windows Debugger", a box appears saying: "There were build errors. Would you like to continue and run the last successful build?"
I pressed "Yes"
Then it shows another box saying "Unable to start the program....the system cannot find the file specified"
The following errors I get to see in the error list:
no operator ">>" matches the operands
operand types are: std::istream >> std::string
I would appreciate your help. Thanks.