Hello! Thanks for the quick reply, i brought another piece of code, a little more 'formal' i think:
#include <iostream>
using namespace std;
void displayOutput(int myArray[], int qOfNumbers);
int main()
{
int inputValues[100] = {};
for(int i = 0; inputValues[i] < 100; i++)
{
int holder;
cin >> holder;
inputValues[i] = holder;
if (inputValues[i] == 42){
displayOutput(inputValues, i);
break;
}
}
}
void displayOutput(int myArray[], int qOfNumbers)
{
for(int a = 0; a < qOfNumbers; a++)
{
cout << myArray[a] << "\n";
}
}