Here, Student_info is a class. I am trying to initialize it with strings of different length but it always give the same size of object, when it is supposed to be dependent on the input string length. Any suggestions? (Name and Company are defined as string variable, not as char arrays)
Structure of class Student_info
{ string name, company;
int yr, age;
}
Student_info *s[5];
s[0]= new Student_info("Aakash Goyal","form MNNIT Allahabad",2,57);
cout<<endl<<s[0]->getCompany()<<" is the company"<<endl;
cout<<endl<<s[0]->getName()<<" is the name and the size is: "<<sizeof(*s[0]);
s[1]= new Student_info("Hare Krishna","Hare Krsna Hare Rama",1,34);
cout<<endl<<s[1]->getCompany()<<" is the company"<<endl;
cout<<endl<<s[1]->getName()<<" is the name and the size is: "<<sizeof(*s[1]);
Student_infoclass.