I am a beginner in CPP and occasionally run into problems, like in this case.
Here is my code
#include <iostream>
#include <vector>
#include <iomanip>
using namespace std;
void outputvector (const vector <int> &);
void inputvector (vector <int> &);
int wagescalc (int x)
{
int y = 200 + 0.9*x;
return y;
}
int main()
{
vector <int> employees(10);
vector <int> sales(10);
vector <int> finalwages(10);
cout << "please enter the employee names" << endl;
inputvector(employees);
cout << "please enter their respective sales";
inputvector(sales);
}
So basically, I wish to store ten employees' names, calculate their final wages based on a calculation mechanism, and then store and output the results. For all of this, I use vectors: The concept I'm currently learning.
Here is the error I get,
**error: invalid initialization of reference of type 'std::vector<int>&'
from expression of type 'std::vector<std::basic_string<char> >'|**
It might be a very basic uestion, but I looked around and couldn't find a solution. Any help would be deeply appreciated.
Aucun commentaire:
Enregistrer un commentaire