0
I have this code in c++ and am getting an error:
#include<iostream>
using namespace std;
template <class T>
void setVector(T* v, int sizeOfV){
for(int i=0;i<sizeOfV;i++)cin>>v[i];
}
void showVector(T* v, int sizeOfV){
for(int i=0;i<sizeOfV;i++)cout>>endl>>v[i];}
That’s the mistake right there:
T não está no escopo
V não está no escopo
Can a template only be used once??? I would like to clarify this question :D