-
Junior Member
Operator overloading
Why we are not using some operators like(.,->),(sizeof()),::,(? for over loading concept.
-
Junior Member
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.
-
Junior Member
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
-
Forum Rules