My function is outside main()
it's this
void Ydisplay(int D1[])
{
for(int i=0;i<a;i++)
{
cout<<"\t<<D1[i];
}
the array D1 is a dynamic array the error is 'a' is undefined it's taken from user so it has to be in main.. but is there any other option?