1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

plz helpp

Discussion in 'C++' started by godofwar47, Jan 3, 2011.

  1. godofwar47

    godofwar47 Banned

    Joined:
    Jan 2, 2011
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    hi guys .i am beginner .plz tell me why is my program problem?plz write answer my question.tnx

    Code:
    #include <iostream>
    using namespace std;
    class test1{
    int x;
    int y;
    public:
    void set_xy(int i,int j){x=i;y=j;}
     friend int equal (test1 t1 ,test2 t2);
    };
    class test2 {
    int x;
    int y;
    public:
    void set_xy (int i,int j) {x=i;y=j;}
    friend int equal (test1 t1,test2 t2);
    };
    int equal(test1 t1,test2 t2)
    {if (t1.x==t2.x  &&  t1.y==t2.y)
    return 1;
    else 
    return 0;}
    int main()
    {
    test1 t1;
    test2 t2;
    t1.set_xy(3,5)
    t2.set_xy(4,5)
    if (equal(t1,t2))
    cout<<"t1 and t2 are equal"<<endl;
    return 0;
    }
     
    Last edited by a moderator: Jan 3, 2011
  2. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,012
    Likes Received:
    203
    Trophy Points:
    0
    Occupation:
    Senior Support Engineer
    Location:
    England
    You were warned here http://www.go4expert.com/showthread.php?t=24348
    about posting duplicate threads.

    DO NOT DO IT AGAIN. If the board admin sees this there's a good chance you might be banned as you clearly don't bother taking any notice of warnings.

    Also, you got an answer to the problem in that thread. As the answer came from me I'm puzzled why you posted the same question again. Was there something wrong with my answer? (If there *was* something wrong with my answer it could be simply down to the fact that you didn't actually describe the problem, so perhaps if I was wrong you could give - in the original thread, not here - more details about exactly what the problem is.)
     
  3. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,276
    Likes Received:
    364
    Trophy Points:
    83
    This is fourth thread and so I had to stop him by banning only.
     

Share This Page