Hi, i'm trying to make 3 different input scenarios using argv. In the code below where there is just one input so when it is argv[0] the calendar for this month comes up, when it is argv[1] so when there are two inputs, it will printout the calendar for the whole year and when it is argv[2] it will printout the calendar for a specific year and month. but i'm getting this warning error at (int year = argv[1]) and (int month = argv[1]) and (int year = argv[2]) and i'm not sure where to start fixing it:
int main(int argc, char* argv[]){
if(argc==2){
int year = argv[1];
if(year<1900 || year>9999){
printf("%d not in range 1900...9999", year);
return 0;
}
calendarYear(year);
return 0;
}
else if(argc>2){
int month = argv[1];
int year = argv[2];
if(month<1 || month>12){
printf("%d is not a month", month);
return 0;
}
if(year<1900 || year>9999){
printf("%d not in range 1900...9999", year);
return 0;
}
calendarMonth(month, year);
return 0;
}
else{
calendarNow();
return 0;
}
return 0;
}