Can Union and struct be considered operators?

Asked

Viewed 98 times

5

One union or a struct can be considered operators? As well as return, goto and sizeof?

1 answer

5

They can’t, just like they can’t return and goto. Only the sizeof there is an operator, and yet he has a special way, because he always runs at compile time. It is no wonder that the only one who can link as operator. Then the question starts from wrong premise.

These are commands statements are reserved words, such as sizeof.

union and struct sane statements also, but they have a more declarative function, they are not exactly imperatives like the previous ones. They determine that there will be a declaration of a union data structure or composite data structure. They declare new types for their code. Therefore they are not operators.

Operators have the function to manipulate (access) data and result in something, are expressions.

More:

Browser other questions tagged

You are not signed in. Login or sign up in order to post.