In C and C++, the calling convention is backwards, i.e. the variable declared last will be pushed into the stack first.
Following example shows the call stack of a function void funct(int i, int j) written in C/C++.

Compiler disassembly

push 30
push 20
call _funct

Address Stack frame Value
0xA0008 j 30
0xA0004 i 20
0xA0000 return address of funct() code address of next to call

About our authors: Team EQA

You have viewed 1 page out of 248. Your C learning is 0.00% complete. Login to check your learning progress.

#