Compiler Error C2870
'name' : a namespace definition must appear either at file scope or immediately within another namespace definition
You defined namespace name
incorrectly. Namespaces must be defined at file scope (outside all blocks and classes) or immediately within another namespace.
The following sample generates C2870:
// C2870.cpp
// compile with: /c
int main() {
namespace A { int i; }; // C2870
}
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for