Here's what I got so far... but for some reason it ain't really doing what i wanted it to.. haa
Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct month{
char monthEng[10];
char monthSpan[11];
int orders;
int numberDays;
};
// put your function declarations here
int find_day(struct month *m, char *user, int day);
void intoStruct(struct month m[]);
int main(void) {
struct month months[12];
intoStruct(months);
int enter_day;
char enter_month;
int monthLeng[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
const char monthschar[12][10] = { "january", "february", "march", "april", "may", "june", "july", "august", "september", "october", "november", "december" };
int i=0;
// code starts here for me.
printf("What month: "); //asking for month
fflush(stdout);
scanf("%s", &enter_month);
printf("What day: "); //asking for day
fflush(stdout);
scanf("%d", &enter_day);
if(enter_day > 31 || enter_day < 1)
{
printf("The entered day of month does not exist. Which was %d", enter_day);
fflush(stdout);
}
// Checking to see if the enter_month is == to english or spanish
for(i = 0; i < 12; i++)
{
if(strcmp(enter_month, monthschar[i]) == 0)
{
strcpy(monthschar[i], enter_month);
printf("The month %s", enter_month);
fflush(stdout);
}
else if(strcmp(enter_month, monthschar[i]) == 0)
{
printf("The month %s", enter_month);
}
else
{
printf("That month cannot be found either in english or in spanish, please check your spelling.");
fflush(stdout);
}
}
// Calling the functions
int findDayCount(m, enter_month, enter_day);
/* English to Spanish
*
*/
return EXIT_SUCCESS;
}
int find_day(struct month *m, char *user, int day){
}
void intoStruct(struct month m[]){
}
So wrote some other declaration functions just in case, i had a feeling I would need them to get the months from the array. Been working on this, debugging it and stuff... And I still can't get it to work. I was talking about this with my friend and he told me, instead of telling the day of the month, why don't you tell the day of the month as well the day of the year. So January 31st will be the 31st day of the year, 31/365 (no leap year included). So I was hmm, thats interesting, that might help me one day. So i tried to wrap my head around it, and its hard haha.
can anyone provide any advice for me?