Compiler Error C2601
TOC
Collapse the table of content
Expand the table of content
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

Compiler Error C2601

'function' : local function definitions are illegal

Code tries to define a function within a function.

Or, there may be an extra brace in your source code before the location of the C2601 error.

Example

// C2601.cpp
int main()
{
   int i = 0;

   int funcname(int j)  // C2601
   {
      j++;
      return j;
   }
   
   i = funcname(i);
   return 0;
}
Show:
© 2016 Microsoft