I got these two errors and I can not figure it out. I basic hit a coders block.
variable or field 'printVector' declared void and missing template arguments before
#include <iostream>
#include <vector>
#include <cctype>
using namespace std;
void printVector(vector<string> vec);
int main() {
vector<string> ivec;
cout<<"Please your sequence of words and ctrl-z to stop"<<endl;
string input;
while(getline(cin, input)){
ivec.push_back(input);
}
cout<<"Your input is: \n";
for(std::vector<string>::iterator it = ivec.begin(); it != ivec.end(); ++it ){
cout<<*it<<"";
}
cout<<"Your input changed to upper case: "<<endl;
printVector(ivec);
return 0;
}
void printVector(vector<string> vec){
for(auto &v: vec){
for(auto &c: v)
cout<<toupper(c)<<"";
}
}
Aucun commentaire:
Enregistrer un commentaire