Need a little help understanding why the addDecade function doesn't work.
It is supposed to add 10 years to the birthdate, but it doesn't do that.
Code:
//structuredemo2.c//demonstrating Structures and functions
#include<stdio.h>
#include<stdlib.h>
struct Date
{
int Month; //members
int Day;
int Year;
};//end structure definition
void AddDecade(struct Date);
int main(int argc, char *argv[])
{
struct Date BDay;
char buffer[50];
printf("What month were you born? ");
BDay.Month = atoi(fgets(buffer, 50, stdin));
printf("What day were you born? ");
BDay.Day = atoi(fgets(buffer, 50, stdin));
printf("What year were you born? ");
BDay.Year = atoi(fgets(buffer, 50, stdin));
printf("You were born on %d, %d, %d.\n", BDay.Month, BDay.Day, BDay.Year);
AddDecade(BDay);
printf("You will be 10 years older on %d, %d, %d\n", BDay.Month, BDay.Day, BDay.Year);
}//end main
void AddDecade(struct Date Target)
{
Target.Year += 10;
}//end AdDecade