C++ noob here. I have searched everywhere for this and found many who had the same problem, but no solutions. What am I doing wrong? I am pulling my hair out!
I have built it and it has no errors. However, when I try to debug it with F5 or ctrl + F5 I get the same error:
"Unable to start program 'c:\users\windows\documents\visual studio 2013\Projects\Project1\Debug\Project1.ex...
The system cannot find the file specified"
Obviously this file does not exist, and I have no idea how to make it exist. Again, I have tried EVERYTHING. Please help!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
//getinfo.cpp -- input and output
#include <iostream>
int main()
{
usingnamespace std;
int carrots;
cout << " How many carrots do you have?" << endl;
cin >> carrots;
cout << "Here are two more. ";
carrots = carrots + 2;
// the next line concatenates output
cout << "Now you have " << carrots << " carrots. " << endl;
return 0;
}
Hmmmm im a bit of noob too but have you tried to include stdafx.h
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
//getinfo.cpp -- input and output
#include "stdafx.h"
#include <iostream>
int main()
{
usingnamespace std;
int carrots;
cout << " How many carrots do you have?" << endl;
cin >> carrots;
cout << "Here are two more. ";
carrots = carrots + 2;
// the next line concatenates output
cout << "Now you have " << carrots << " carrots. " << endl;
return 0;
}
Looks fine to me , and you don't need to include stdafx.h, try to download another compiler , also put this before the return statement so the program won't close after the cin>>carrots; statement