Why are we giving void as a parameter for the getdetails function, i.e, getdetails(void) and not (char name, int rollNO) as a parameter? Why is this being done only while using array of class objects. Why?
class student
{
private:
char name[30];
int rollNo;
public:
void getDetails(void); // Member function to get student's details
void putDetails(void); // Member function to print student's details
};
void student::getDetails(void) // Member function definition, outside of the class
{
cout << "Enter name: ";
cin >> name;
cout << "Enter roll number: ";
cin >> rollNo;
}