Cześć :)
Do rzeczy podczas kompilacji wyskakuje błąd:
In function 'int main()':|
42|error: cannot convert 'std::basic_ios<_CharT, _Traits>::good<char, std::char_traits<char> >' from type 'bool (std::basic_ios<char>::)()const' to type 'bool'|
||=== Build failed: 1 error(s), 0 warning(s) (0 minute(s), 5 second(s)) ===|
Błąd pokazuje się na 4 linijce na if'ie
if(choice1=='1')
{///Sprawdz ilosc
system("cls");
if(ifstream("file.txt").good)
{
file.open("file.txt",ios::in);
file>>pigs;
file>>chickens;
file>>cows;
file>>sheeps;
file.close();
cout<<"=============="<<endl;
cout<<"Ilosc zwierzat"<<endl;
cout<<"Swinie:"<<pigs<<endl;
cout<<"Kury:"<<chickens<<endl;
cout<<"Owce:"<<cows<<endl;
cout<<"Swinie:"<<sheeps<<endl;
cout<<"=============="<<endl;
cout<<endl;
system("pause");
}
else
{
cout<<"Brak pliku zapisu!"<<endl;
system("pause");
}
}///Sprawdz ilosc