Please help, I do not understand the correlation between the function definition and the call in main. My program is receiving build errors- please assist with determining what the definition of this program should be. Thank you!

#include <iostream>
using namespace std;


void yrCalc(int totalDays, int& year, int& month, int& day);

      
int main ()
{
  
     int year, month, day, totalDays;

     year = 1900 + totalDays / 365;
     totalDays = year * 365;

     yrCalc(40000, year, month, day);

     cout << year << " - " << month << " - " << day << endl;
	   
  	
return 0;
}
void yrCalc(int totalDays a, int& year b, int& month c, int& day d)
 (
     totalDays = a;
     year = b;
     month = c;
     day = d;
    return;
 }

line 23 should look like this: void yrCalc(int totalDays, int& year, int& month, int& day) If you do that then you also have to change lines 25-28 to use the valid variable names shown above.

if you're gonna pass the address of the variables as stated in line 23:
void yrCalc(int totalDays, int& year, int& month, int& day)

Your variables should contain also their address in line 16:
yrCalc(40000, &year, &month, &day);

if you're gonna pass the address of the variables as stated in line 23:
void yrCalc(int totalDays, int& year, int& month, int& day)

Your variables should contain also their address in line 16:
yrCalc(40000, &year, &month, &day);

Not so -- you are thinking C, not C++ because yrCals() does not take pointers.

This question has already been answered. Start a new discussion instead.