Can I set a default argument from a previous argument?

后端 未结 7 1777
终归单人心
终归单人心 2020-11-27 20:09

Is it possible to use previous arguments in a functions parameter list as the default value for later arguments in the parameter list? For instance,

void f(         


        
7条回答
  •  感情败类
    2020-11-27 20:37

    No, you cannot do that.
    You will surely get an error "Local variable may not appear in this context".

提交回复
热议问题