Hey, /wsr/. I noticed in the sticky that this board helps with homework.
I have 3 c++ programs that are pretty much finished i just need some help fixing some things.
Thanks
OK.
Done.
so you will help me?
just post your problem feggit
no match for 'operator=' (operand types are 'std::vector<std::basic_string<char> >' and 'std::string {aka std::basic_string<char>}')
It's been a while since I've done C++ but of course that's a type error. See if you can fix it with typecasting. Looks like your vector isn't actually of type string? It's a finicky language, if you google your error I'm sure stackoverflow has already answered your problem.
>>81035
>vector<some_type> variable_name[WHAT_THE_FUCK_ARE_YOU_DOING_HERE_NIGGER];
There's your problem, you're creating an ARRAY OF vector<some_type> and not vector of that size. If you want to pre-allocate the size of the vector use "variable_name(size, starting_value)" or just "variable_name(size)".
And why use vectors in the first place? A dumb array (or std::array) is good enough:
struct student{
string name;
double score;
};
student students[5];
double totalScores=0;
for(kid : students){
cout<<"Enter the name of the student: ";
cin >> kid.name;
cout<<"Enter "<<kid.name<<"'s test score: ";
cin>>kid.score;
totalScores+=kid.score;
}
cout<<"The average test score is "<<totalScore/5<<endl;