What happens in memory when calling a function with literal values?

Posted by Drise on Stack Overflow See other posts from Stack Overflow or by Drise
Published on 2012-06-11T22:29:50Z Indexed on 2012/06/11 22:40 UTC
Read the original article Hit count: 170

Filed under:

Suppose I have an arbitrary function:

void someFunc(int, double, char); 

and I call someFunc(8, 2.4, 'a');, what actually happens? How does 8, 2.4, and 'a' get memory, moved into that memory, and passed into the function? What type of optimizations does the compiler have for situations like these? What if I mix and match parameters, such like someFunc(myIntVar, 2.4, someChar);?

What happens if the function is declared as inline?

© Stack Overflow or respective owner

Related posts about c++