I am working on a code for school and keep getting that error. It also likes to tell me my file does not exist. not recognized as an internal or external command, an operable program or batch file
It's a simple problem so i dont know what it is giving me this much trouble. Although visual studio has been acting up for me a lot lately.
This is what I have thus far:
#include <iostream>
#include <iomanip>
#include <string>
usingnamespace std;
struct fruitType{
string name;
string color;
int fat;
int sugar;
int carbohydrate;}
int main () {
fruitType fruit;
cout << "Which fruit do you like?" <<endl;
cin >> fruit.name;
cout <<" What is the fruits color?" <<endl;
cin >> fruit.color;
cout <<"What is the fat value in that fruit?" <<endl;
cin >> fruit.fat;
cout <<"What is the sugar value in that fruit?" <<endl;
cin >> fruit.sugar;
cout <<"what are the carbohydrate levels in that fruit?" <<endl;
cin >> fruit.carbohydrate;
cout<< "Fruit Details:" <<endl;
cout <<"Name: "<< fruit.name << endl;
cout <<"Color: " << fruit.color <<endl;
cout <<"Fat: " <<fruit.fat <<endl;
cout <<"Sugar: " <<fruit.sugar <<endl;
cout <<"Carbs: "<< fruit.carbohydrate <<endl;
return 0;
}
There needs to be a semicolon at the end of your struct declaration. The other errors could be attributed to anything from your Anti-virus auto protection to a dying HDD. Try running a check disk the next time you get a chance. How else has Visual Studio been acting up?