我已经在命名空间内创建了一个类,现在当我必须使用或调用命名空间时出现问题,编译器错误的可能原因是什么?
namespace name1
{
class show
{
int a,b;
void accept_data(void);
void display_data(void);
friend void use_class(void);
};
}
编译器错误 -
test1.cpp:在函数'void use_class()'中:
test1.cpp:17:6:错误:'void name1::show::accept_data()'是私有的
test1.cpp:31:16:错误:在此上下文中
test1.cpp:24:6: error: 'void name1::show::display_data()' is private
test1.cpp:32:17: error: 在这个上下文中