I am a beginner in programming, so bear with me. I keep getting an error for this code saying:
error C2664: 'activity' : cannot convert parameter 1 from 'char' to 'client_activity []'
I am testing here to see if my function will pass the array back to main() so that I can call the function correctly. I don't know if I am declaring the arrays in the wrong places or if I am using the function parameters incorrectly. Thanks for any help!
#include<iostream>
#include<iomanip>
#include<string>
#include<cctype>
#include<fstream>
using namespace std;
struct client_activity
{
char action;
string name;
int amount;
};
void activity(client_activity activites[]);
int main()
{
ifstream past_loans, days_activity;
ofstream current_loans, donfile, michaelfile, sonnyfile;
client_activity activities[19];
// past_loans.open("past_loans.txt");
//days_activity.open("days_activity");
cout << activity(activities[0].action) << endl;
return 0;
}
void activity(client_activity activites[])
{
ifstream days_activity;
days_activity.open("days_activity");
client_activity activities[19];
activities[0].action= 'p';
while (!days_activity.eof())
{
}
}