description | title | ms.date | f1_keywords | helpviewer_keywords | ms.assetid | ||
---|---|---|---|---|---|---|---|
Learn more about: Compiler Error C2587 | Compiler Error C2587 | 11/04/2016 |
|
| 7637a2c7-35d4-4b5a-a8f2-515a7bda98fd |
'identifier' : illegal use of local variable as default parameter
Local variables are not allowed as default parameters.
The following sample generates C2587:
// C2587.cpp// compile with: /cint i; voidfunc() { int j; externvoidfunc2( int k = j ); // C2587 -- local variableexternvoidfunc3( int k = i ); // OK }