in DS
989 views
0 votes
0 votes
is there any operator in c which is context dependent?????????????/
in DS
989 views

1 comment

what is context dependent????
1
1

1 Answer

2 votes
2 votes

If by "context" you meant, the operators which behave differently as per usage (context).

then Yes, there are operators which are context dependent. Usually these are the ones which can be used can both unary and binary operators. Though I am not sure if we can call them context dependent, as they are different operators (because of being in different categories unary and binary) but have same symbol.

For example: $*$ which can be unary and binary. 

print("%d", *a);         ----> is a deference operator

print("%d", a*b);       ----> is a multiplication operator

Others are &, which can be used to print address of in unary form while is logical AND when used in binary form.

I am able to think of these operators only...Others to add more..