What is a formal parameter?

前端 未结 3 1280
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-08 07:37

When compiling in C++ I often end up with error messages dealing with \"formal parameters\", such as

error C2719: \'b\': formal parameter with __declspec(ali         


        
3条回答
  •  清歌不尽
    2020-12-08 08:25

    Formal parameters are the parameters known at the function definition. The actual parameters are what you actually (hence the name) pass to the function when you call it.

    void foo( int a ); // a is a formal parameter
    
    foo(10); // 10 is the actual parameter
    

提交回复
热议问题