c - Why isn't there a "<--" operator? -
this question has answer here:
- what “-->” operator in c++? 21 answers
i going through k&r c book , got through -->
operator in precedence table. so, wondered if there similar operator i.e., <--
, wrote following program:
#include<stdio.h> void main() { int x = 5; while(0 <-- x) printf("%d",x); }
it worked fine. why isn't <-- not considered operator? (as not in precedence table!) , it's precedence?
-->
not 1 operator, two; (post) decrement , less than. c whitespace agnostic part, so:
x --> y /* same */ x-- > y
<--
same idea:
x <-- y /* same */ x < --y
perhaps confusing ->
-->
. ->
dereferences pointer @ member of type refers to.
typedef struct { int x; } foo; int main(void) { foo f = {1}; foo *fp = &f; printf("%d", fp->x); return 0; }
<-
not operator @ all.
Comments
Post a Comment