Compiler Error C3161
Visual Studio 2015
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 C3161.
interface' : nesting class, struct, union or interface in an interface is illegal; nesting interface in a class, struct or union is illegal
An __interface can only appear at global scope or within a namespace. A class, struct, or union cannot appear in an interface.
The following sample generates C3161.
// C3161.cpp
// compile with: /c
__interface X {
__interface Y {}; // C3161 A nested interface
};
Show: