Your constructor is broken and leaves all pointers unassigned. You cannot use the value of a variable until you assign it.
Also, which crappy compiler do you use or what settings do you have? Pointers to constants are passed to your constructor, but it accepts non-constant pointers. This should have triggered a warning, indicating that these pointers were mishandled.
studentinfo s1("mc130202398", "PMTN08", "Rehan Shahzad Siddiqui","Rizwan Ali Siddiqui");
Note that you are passing a bunch of constants to the constructor.
studentinfo::studentinfo(char* VUID, char* campusID, char* Studentname, char* Fathername)
Oops, but the constructor accepts regular char* pointers. So what should these pointers indicate?
Tip. Use smart C ++ classes like std::string and these problems will magically disappear.
source share