Compiler Error C2162

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at Compiler Error C2162.

expected macro formal parameter

The token following a stringizing operator (#) is not a formal parameter name.

The following sample generates C2162:

// C2162.cpp  
// compile with: /c  
#include <stdio.h>  
  
#define print(a) printf_s(b)   // OK  
#define print(a) printf_s(#b)    // C2162  

Show: