I want to do a overloading private fucntion to see it work, didnt have any compile error, it said a weird answer on the console. Do you know the reason it might be.
Using Software DevC++
# include <iostream>
# include <iomanip>
using namespace std;
data obj1;
obj1.sname(thename[0]);
obj1.stitle(thetitle[0]);
obj1.soccup(theoccup[0]);
obj1.sid(theid[0]);
data obj2(thename[1],thetitle[1],theoccup[1],theid[1]);
data obj3( thename[2],thetitle[2]);
obj3.soccup(theoccup[2]);
obj3.sid(theid[2]);
data obj4(thename[3]);
obj4.stitle(thetitle[3]);
obj4.soccup(theoccup[3]);
obj4.sid(theid[3]);
I would recommend changing IDEs to Code::Blocks and trying again because I didn't get any errors when compiling, building, and running your code. Though I don't know what the output is supposed to be so there isn't much I can comment beyond maybe you're using an outdated IDE/Compiler. Get Code::Blocks and try the code again, then post any errors here.
THX for that reply , i wanted assign values from the private classes but it work. when i wrote
data obj4(thename[3]);
obj4.stitle(thetitle[3]);
obj4.soccup(theoccup[3]);
obj4.sid(theid[3]);
should of been 2 instead of three, works now. thx for the help. love you guys.
# include <iostream>
# include <iomanip>
using namespace std;
data obj1;
obj1.sname(thename[0]);
obj1.stitle(thetitle[0]);
obj1.soccup(theoccup[0]);
obj1.sid(theid[0]);
data obj2(thename[1],thetitle[1],theoccup[1],theid[1]);
data obj3( thename[2],thetitle[2]);
obj3.soccup(theoccup[2]);
obj3.sid(theid[2]);
/* data obj4(thename[3]);
obj4.stitle(thetitle[3]);
obj4.soccup(theoccup[3]);
obj4.sid(theid[3]);*/