Here is some code that is probably all f'd up:
int main()
{
int year;
char ans;
ans = y;
while(ans==y)
{
cout<<"What Year?";
cin>>year;
cout<<endl<<year<<endl;
date(year);
cout<<"Would you like another date? (y/n)";
cin>>ans;
}
cout<<"Thank you"<<endl;
return 0;
}
It keeps telling me " y undeclared first use the function, i have tried a million variation, i dont know what the deal is. Here is the same code in If-Else format, i think.
int main()
{
int year;
bool ans;
cout<<"Would you like to enter a date?(y/n):";
cin>>ans;
if(ans==y)
{
cout<<"Enter the year(for example, 1999):";
cin>>year;
cout<<endl<<year<<endl;
date(year);
cout<<"Would you like to enter another date?(y/n):";
cin>>ans;
}
else
{
cout<<"Thank you"<<endl;
}
return 0;
}
Any help would be great. Oh yeah the if then has the same y is undeclared thing.