Trying to figure out a class declaration for the following code:
vector<int> myinputs;
random_vector(k,100,myinputs);
print_vector(myinputs);
So far I have this but I don't know if I'm heading in the right direction, or if I am where to go from here:
template <class T>
class RandomVector
{
public:
T random_vector();
void print_vector(vector<T> & data);
};
template <class T>
void RandomVector<T>::print_vector(vector<T> & data)
{
typename vector<T>::iterator it;
for (it= data.begin(); it != data.end(); it++)
cout << *it;
}
template <class T>
T RandomVector<T>::random_vector()
{
vector<T> data(srand);
for (int i=0; i<data.size(); i++)
data[i] = srand;
}