Okay.... I really can't find out whats wrong with my findDayCount function..
Code:
int findDayCount(struct month *m, char *user, int day){
int total=0;
int i;
int test=0;
// Checking to see if the enter_month is == to english or spanish
for(i = 0; i < 12; i++)
{
if(strcasecmp(user, m[i].nameEng) == 0)
{
strcpy(user, m[i].nameEng);
printf("You entered in the month, %s, in english.\n", user);
fflush(stdout);
test = 1; break;
}
else if(strcasecmp(user, m[i].nameSpan) == 0)
{
strcpy(user, m[i].nameSpan);
printf("You enterd in the mont, %s, in spanish.\n", user);
fflush(stdout);
test = 1; break;
}
if(test == 0)
{
printf("That month cannot be found either in english or in spanish, please check your spelling.\n");
fflush(stdout);
return -1;
}
}
// Checking to see if the days are in the right range.
if(day > 31 || day < 1)
{
printf("There are no %d days in that month.\n", day);
fflush(stdout);
}
else if(day > 28 && ( (user == "february") || (user == "febrero") ) )
{
printf("There are no %d in the month, %s. There is only 28.\n", day, user);
fflush(stdout);
}
else if(day > 30 && ( (user == "april") || (user == "june") || (user == "august") || (user == "september") || (user == "november") ) )
{
printf("There are no %d in the month, %s. There are only 30 days.", day, user);
fflush(stdout);
}
else if(day < 1)
{
printf("There are is no zero day. Did you type in the day correctly?\n");
fflush(stdout);
}
total = m[i].numDays + day;
return(total);
}
it still tells me that I'm typing in the months wrong, except for january. Like january works fine.
and the "total" comes out to be -1 or some weird number haha. RAWR~ lol