函数参数推送顺序 [英] Function arguments push order

查看:55
本文介绍了函数参数推送顺序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么函数参数以从右到左的顺序推入堆栈?

Why are function arguments pushed on the stack in right to left order?

推荐答案

启用存在可变数量参数的函数,例如printf.该函数可以提取第一个或第二个参数,然后使用它们的值来推断堆栈上的参数总数.

To enable the existence of functions with a variable number of arguments, like printf. The function can extract the first one or two arguments and then use their values to deduce the total number of arguments on the stack.

这篇关于函数参数推送顺序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆