Question: What does evaluation of variable mean?

```
int main(){
   int variable;
   variable;
}

```

What does "variable" do? Why evaluation of "variable" should produce its own value?

Answer: 
To "evaluate an expression" means to compute its result and execute its side effects.

Expression `variable` has no side effects. (Unlike something like `x = 1` or `printf("abc")`).

It's result has type `int` (determining the type is not a part of the evaluation, because it never requires runtime computations), and the result has some arbitrary value (actually reading the value would cause undefined behavior, since the variable is uninitialized). This result also has an address, which is the address of `variable` (you can apply `&` to this expression and get that address).

In short, `variable;` doesn't do anything.

---

> 
> [cppreference](https://en.cppreference.com/w/cpp/language/eval_order)
> 
> 
> Evaluation of each expression includes:
> 
> 
> * *value computations*: calculation of the value that is returned by the expression. This may involve determination of the identity of the object (glvalue evaluation, e.g. if the expression returns a reference to some object) or reading the value previously assigned to an object (prvalue evaluation, e.g. if the expression returns a number, or some other value)
> * Initiation of *side effects*: access (read or write) to an object designated by a volatile glvalue, modification (writing) to an object, calling a library I/O function, or calling a function that does any of those operations.
> 
> 
>
In C++, as with other languages, *expressions* are *evaluated*, typically to return a singular value. This happens by following the [operator precedence rules](https://en.cppreference.com/w/cpp/language/operator_precedence) to apply operators in the correct order.1

In the simplest case:

```
int x = 2;
int y = x + x * x;

```

Where the *right-hand-side* (relative to the `=` assignment operator) of the expression requires evaluation in each case. In the first statement it's easy, it's just `2`. In the second the evaluation order rules apply and you get `2 + 4` or `6`.

Evaluation is the process of applying *every* operator in the correct order which will yield a singular value, the result of that expression.

Think about evaluation as similar to how you might when determining the result of a mathematical formula. Different rules apply, but the principles are the same.

---

1 The order arguments are evaluated may not necessarily be the order in which they're defined.