I'm having trouble understanding what Netbeans is trying to tell me. This isn't Homework at all, just practice. It says that there is a problem with the main () and turns line 43 red, and then a problem with dateUpdate(date today) on line 22. Any ideas?
Code:
/*
* File: main.c
* Author: roberto
*
* Created on October 4, 2012, 10:00 AM
*/
#include <stdio.h>
struct date
{
int month;
int day;
int year;
};
//Function to Calculate Tomorrow's Date
struct date dateUpdate (struct date today)
{
struct date tomorrow;
int numberOfDays(struct date d); //ONE OF MY PROBLEMS
if (today.date != numberOfDays (today)){
tomorrow.day = today.day + 1;
tomorrow.month = today.month;
tomorrow.year = today.year;
}
else if (today.month==12){
tomorrow.day =1;
tomorrow.month =1;
tomorrow.year = today.year +1;
}
else {
tomorrow.day =1;
tomorrow.month = today.month +1;
tomorrow.year = today.year;
}
return tomorrow;
}
int main () //ONE OF MY PROBLEMS
{
struct date dateUpdate (struct date today);
struct date thisDay, nextDay;
printf("Enter Today's Date (mm dd yyyy): ");
scanf("%i%i%i", &thisDay.month, &thisDay.day, &thisDay.year);
nextDay = dateUpdate (thisDay);
printf("Tomorrow's date is %i/%i/%.2i.\n", nextDay.month, nextDay.day, nextDay.year % 100);
return 0;
}