c - Are temporary values like operands of arithmetic operators put in the stack? -


i know happens in memory when use arithmetics operators like:

int i; = 5 + 3; 

will values 5 , 3 automatically put stack temporarily (like if static variables automatically created them)? suppose need exist somewhere addition happen, where?

what happens when there function call involved?

i = 5 + f(3); 

is argument 3 passed f stored somewhere? , return value of f (say f returns int)?

many thanks,

your first example evaluated @ compile-time (see http://en.wikipedia.org/wiki/constant_folding), let's ignore one.

in case of i = f(3) + g(5), compiler has many choices on how implement this, depending on particular platform you're working on. may put things in registers, or on stack, or elsewhere, sees fit.


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -