Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the arity of , operator?

Tags:

c

Arity is the number of operand(s) an operator can take. For example, +, -, * and & are the operators that can be used as both unary (one operand) and binary (two operands). ?: is the only operator which takes three operands (that's why it is called ternary operator).

But what is the arity of , (comma) operator?

like image 770
Sangeeth Saravanaraj Avatar asked Dec 29 '11 13:12

Sangeeth Saravanaraj


1 Answers

The comma operator is a binary operator, as indicated by its definition in the C Standard, §6.5.17:

Syntax
    1 expression:
            assignment-expression
            expression , assignment-expression
like image 98
Philip Avatar answered Oct 24 '22 21:10

Philip