|
|
#include <vector>
|
|
A option could be the use of a vector<int> : #include <vector> (replace the second and third for loop by ) std::vector<int> v; for (unsigned int i = 0; i < size; i++) { if (arrOfIntegers[i] != max && arrOfIntegers[i] != min) v.push_back(arrOfIntegers[i]); } for (unsigned int i = 0; i < v.size(); i++) { std::cout << v[i] << std::endl; } another could be to store the result in another array. |
|
|
|
|