Passing too many arguments to printf

前端 未结 5 993
不思量自难忘°
不思量自难忘° 2020-11-30 10:56

Any C programmer who\'s been working for more than a week has encountered crashes that result from calling printf with more format specifiers than actual argume

5条回答
  •  佛祖请我去吃肉
    2020-11-30 11:26

    All the arguments will be pushed on the stack and removed if the stack frame is removed. this behaviour is independend from a specific processor. (I only remember a mainframe which had no stack, designed in 70s) So, yes the second example wont't fail.

提交回复
热议问题