struct student
{
char *name;
int roll_no;
};
student s1[3];
for(int i=0;i<3;i++)
{
cout<<"Enter name: ";
cin.getline(s1[i].name,'\n');
cout<<"\nEnter roll number : ";
cin>>s1[i].roll_no;
}
I want to take full name input in "char* name", but this is not working I know , I can use string but is there any way to do this with char* ?