So my program requires me to make a function in one file, and call it into another.
I have one file called convertdays.cpp like this:
#include <iostream>
int convertdays(int, int, int);
int convertdays(int month, int day, int year)
{
int date;
date = year * 1000 + month * 100 + day;
return date;
}
Then I have another file where my int main() stuff is, like this:
#include <iostream>
using namespace std;
int main()
{
int day, month, year;
cout << "Please enter the month: " << endl;
cin >> month;
cout << "Please enter the day: " << endl;
cin >> day;
cout << "Please enter a year: " << endl;
cin >> year;
convertdays(month, day, year); //convertdays stays in red though.
//Still need to add a couple of more things but not necessary right now.
system("Pause");
return 0;
}
How do I make this work where I can keep all of my functions in another file and call them in when I need them?