If this is to become a standards-compliant C++ program, the correct headers should be used:
Neither <iostream.h> nor <conio.h> exist under C++.
#include <iostream>
using std::cout;
The getdata() member function cannot work like this.
void getdata()
{
cout << "Select menu";
}
do {
...
} while (select_menu != 5);
On the one hand, curly brackets are wrong, on the other hand, the select_menu variable is not read in, so the do-while loop does not work. It would be better to separate the declaration of the class from the implementation. Preferably in two separate files.
class menu
{
public:
int getMenu();
private:
char select_menu;
char name[20];
char branch[20];
int en_no;
};
int menu::getMenu()
{
cout << "Select menu\n";
return select_menu;
}
//Edit:
Since several similar data records are to be managed later on, it makes sense to manage them in a separate structure or class.
typedef struct {
std::string name;
std::string branch;
int en_no;
} studentdata;
Containers such as string, array, vector, ... are preferably used under C++.