Abstract

The additive expression is used to calculate the sum or difference of two numberic values.  Normal numeric promotions are applied before the operation is performed. 

Syntax

Syntax Diagrams

Additive Expression Syntax Diagram

BNF

additive-expression
::= <additive-expression> <additive-operator> <multiplicative-expression>
::= <multiplicative-expression>

EBNF

additive-expression
::= <multiplicative-expression> ( <additive-operator> <multiplicative-expression> ) *

Form

additive-operator
addition-operator | subtraction-operator
addition-operator
+
subtraction-operator
-

Semantics

additive-operator
If neither operand is a pointer, the value of the expression is the mathematical result of applying the operator to the values of the operands.  Normal type promotions are applied, if necessary, before application of the operator.  The type of the expression result is the same as the promoted operands.
If one operand is a pointer, and the other is an integer, the integer operand is multiplied by the size of the target of the pointer before the operation is performed.  The type of the expression result is the same as the pointer operand.

Reference Links

Additive Operators <additive-operator>
Multiplicative Expression <multiplicative-expression>

Other Languages

C Now
C Additive Expression
C++ Now C++ Additive Expression
Java Now Java Additive Expression
JavaScript Now JavaScript Additive Expression
PHP Now PHP Additive Expression