#include <iostream>
#include <string.h>
using namespace std;
int nos;
string stddata[1000][2];
void pop(int);
void output(int);
int main()
{
cout<<"Enter number of students: ";
cin>>nos;
pop(nos);
output(nos);
}
void pop(int nos)
{
for(int i=0;i<nos;i++)
for(int il=0; il<2;il++)
getline(cin,stddata[i][il]); // when i=0 && il = 1 compiler skips it
}
void output(int nos)
{
cout<<"\t\t RESULT \n";
for(int i=0;i<nos;i++)
for(int il=0; il<2; il++)
cout<<stddata[i][il]<<"\t"
}
inner loop of function pop then loop has to execute 2 times but it executes only one time skipped the 2nd one why it is happening? only when we using getline