#include <iostream>
using namespace std;
int main()
{
int size = 0;
int n[size];
do
{
cin>>n[size];
size++;
}while(n[size-1] != 42);
cin>>n[size];
for(int i = 0; i < (size-1); i++)
{
cout<<n[i]<<endl;
}
return 0;
}
Hello everyone,
When i compile it it outputs the correct answer, however judge points me out to a runtime error (SIGSEGV).
What is wrong with the code then?
Thanks in advance, and glad to join this community.