hi , I have an code, in that code i want know when i will get a duplicate value since values are generated at runtime. could you know the duplicate value by overloading < and == operators. #include #include class A { unsigned long la; unsigned long lb; unsigned long lc; public: A() { la=lb=lc=0; } A(unsigned long ln,unsigned long lm,unsigned long lo) { la=ln; lb=lm; lc=lo; } A(const A& objref) { la=objref.la ; lb=objref.lb; lc=objref.lc; } A& operator =(const A& objref) { if(this!=&objref) { la=objref.la; lb=objref.lb; lc=objref.lc; } return *this; } bool operator==(const A& objref) const { bool b=(((la==objref.la)&&(lb==objref.lb)&&(lc==objref.lc))?1:0); return b; } /* bool operator<(const A& objref) const { if((((la==objref.la)&&(lb==objref.lb)&&(lc==objref.lc))?1:0)) { cout<<"Attempting insert a duplicate value -"<<"("< using namespace std; typedef std::map Aptrmap; int main(int argc, char* argv[]) { A objOne(0,1,2); A objTwo(0,1,2); A objThree(0,1,1); A objFour(3,4,0),objFive(4,4,5); float *pfa,*pfb,*pfc,*pfd,*pfe; pfa= new float(1.10); pfb= new float(2.20); pfc= ne
sarath_babu
Posts
-
How do you know the duplicate key insertion in STL map -
How do you know the duplicate key insertion in STL mapIs there any way to indicate the duplicate key insertion in STL map. Here the key should be a class object.
-
How do you know the duplicate key insertion in STL mapIs there any way to indiccate the insertion of duplicate key in STL map babu.p
-
Change Fontmy yahoo id is babu_ooty18 just make it as friend ,i am available now
-
Change Fontgive sp_updateINIchange and sp_updatreginichange options it will change aLL apps, i tested it was working
-
How to get the path of a file in VC++hi, use the win32findfile data strcture an use cfindfile class mfc or findfile apis
-
Change Fonthi,use the api SystemParametersinfo with nm_nonclientmetrics as type and fill in the desired font in nm strcture
-
activex ctrl in modeless dialogI am using a modeless dialog box with activex controls. If I remove the activex controls then it is working correctly otherwise it is giving assertion failure error At the line containing dialogboxname.ShowWindow() function. Tell me what is wrong. babu
-
activex ctrl in modeless dialogI am using a modeless dialog box with activex controls. If I remove the activex controls then it is working correctly otherwise it is giving assertion failure error At the line containing dialogboxname.ShowWindow() function. Tell me what is wrong. arun
-
how to create a porthow to create a lpr port in windows 2000 without user interface ashees
-
char * & char []What is the difference between char *ptr="babu" char ptr[]="babu" babu