-1
switch (option) {
case 1:
int var;
std::vector<int>v(size);
std::list<int>l;
std::cout << "Digite os elementos do container (vector): ";
for (int i = 0; i < size; i++) {
std::cin >> v[i];
}
std::cout << "Digite os elementos do container (list): ";
for (int i = 0; i < size; i++) {
std::cin >> var;
l.push_front(var);
}
bubbleSort(v);
bubbleSort(l);
for (auto x : v) {
std::cout << x << " ";
}
std::cout << "\n";
for (auto x : l) {
std::cout << x << " ";
}
std::cout << "\n";
break;
case 2:
double var;
std::vector<double>v(size);
std::list<double>l;
std::cout << "Digite os elementos do container (vector): ";
for (int i = 0; i < size; i++) {
std::cin >> v[i];
}
std::cout << "Digite os elementos do container (list): ";
for (int i = 0; i < size; i++) {
std::cin >> var;
l.push_front(var);
}
bubbleSort(v);
bubbleSort(l);
for (auto x : v) {
std::cout << x << " ";
}
std::cout << "\n";
for (auto x : l) {
std::cout << x << " ";
}
std::cout << "\n";
break;
case 3:
char var;
std::vector<char>v(size);
std::list<char>l;
std::cout << "Digite os elementos do container (vector): ";
for (int i = 0; i < size; i++) {
std::cin >> v[i];
}
std::cout << "Digite os elementos do container (list): ";
for (int i = 0; i < size; i++) {
std::cin >> var;
l.push_front(var);
}
bubbleSort(v);
bubbleSort(l);
for (auto x : v) {
std::cout << x << " ";
}
std::cout << "\n";
for (auto x : l) {
std::cout << x << " ";
}
std::cout << "\n";
break;
}
Why am I getting this message ? What would that be?
Error (active):
variable "v" (declared in row 29)
variable "l" (declared in row 30)
variable "v" (declared in row 58)
variable "l" (declared in row 59)
The problem was solved fought by the help! D
– sekif