Why we are not using some operators like(.,->),(sizeof()),::,(?:) for over loading concept.
Printable View
Why we are not using some operators like(.,->),(sizeof()),::,(?:) for over loading concept.
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.
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.