c - Why isn't there a "<--" operator? -


this question has answer here:

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

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -