id
and
name
are only accessible from the
input
method; you'll have to make them accessible from
output
too, for example:
int id;
char name[20];
void input()
{
cout<<"Enter the student id:"<<endl;
cin>>id;
cout<<"Enter the student name:"<<endl;
cin>>name;
}
void output()
{
cout<<"The Student id is: "<< id <<endl;
cout<<"The Student name is: "<< name <<endl;
}