Export (0) Print
Expand All
Expand Minimize

Compiler Error C2310

catch handlers must specify one type

A catch handler specified no type or multiple types.

The following sample generates C2310:

// C2310.cpp
// compile with: /EHsc
#include <eh.h>
int main() {
   try {
      throw "Out of memory!";
   }
   catch( int ,int) {}   // C2310 two types
   // try the following line instead
   // catch( int)  {}
}

Community Additions

ADD
Show:
© 2014 Microsoft