So i get the above mentioned error in the line of code: "women[count_wc] = (temp);" [Error] cannot convert 'std::string {aka std::basic_string}' to 'char' in assignment - C++
which is inside the function being called.
Also another error is found in the place where the function is actually being called. the error at "get_comp_women(women, MAX_W, array, ROW);" is [Error] could not convert '(std::string*)(& women)' from 'std::string* {aka std::basic_string*}' to 'std::string {aka std::basic_string}'
const int MAX_W = 18;
const int MAX_T = 18;
const int MAX_E = 14;
const int ROW = 89;
using namespace std;
struct data
{
string name;
string event;
};
void get_comp_women(string women, int MAX_W, data array[], int ROW)
{
int count_wc = 0;
int count_wn = 0;
int event_occ = 0;
string temp;
temp = (array[0].name);
event_occ = (ROW + MAX_W);
for (int i = 1; i < event_occ; i++)
{
if (temp == array[count_wn].name)
{
women[count_wc] = (temp);
count_wn++;
}
else
{
temp = array[count_wn].name;
count_wc++;
}
}
int main()
{
string women[MAX_W];
data array[ROW];
get_comp_women(women, MAX_W, array, ROW);
}
Aucun commentaire:
Enregistrer un commentaire