65,210
社区成员
发帖
与我相关
我的任务
分享
//.h文件
class A
{
protected:
struct B
{
int a;
char str[4];
};
static const B m_b[3];
};
//.cpp文件
const B A::m_b[]=
{
{...},
{...},
{...},
};
//.h文件
class A
{
protected:
struct B
{
int a;
char str[4];
};
static const B m_b[3];
};
//.cpp文件
const A::B A::m_b[]=
{
{1, "123"},
{1, "123"},
{1, "123"},
};
#include <iostream>
using namespace std;
class A
{
protected: // 你这里是中文冒号
struct B
{
int a;
char str[4];
};
static const B m_b[3];
};
const A::B A::m_b[]=
{
{1,"a"},
{2,"b"},
{3,"c"}
};