Results 1 to 3 of 3

Thread: Operator overloading

  1. #1
    Junior Member
    Join Date
    Apr 2008
    Answers
    1

    Operator overloading

    Why we are not using some operators like(.,->),(sizeof()),::,(? for over loading concept.


  2. #2

    Re: Operator overloading

    It is one of the oops concepts ,with operator overloading we can add some additional meaning to operators such as +,-,* etc, which is not possible in C language.

    Basically in C language the operators such as + is used only on standard datatypes,but with operator overloading we can use this operators even on userdefined datatypes.


    ex..

    struct add
    {
    flaot a,b;
    }s1,s2,s3;
    main()
    {
    s3 = s1 + s2;
    }
    here we can use + operator on datatype such as struct which in not standard.


  3. #3

    Re: Operator overloading

    It is one of the oops concepts ,with operator overloading we can add some additional meaning to operators such as +,-,* etc, which is not possible in C language.

    Basically in C language the operators such as + is used only on standard datatypes,but with operator overloading we can use this operators even on userdefined datatypes.


    ex..

    struct add
    {
    flaot a,b;
    }s1,s2,s3;
    main()
    {
    s3 = s1 + s2;
    }
    here we can use + operator on datatype such as struct which in not standard.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact