範例

struct MyStruct {
public:
void function(){}
int member;
 

};

解決方案
使結構成為類別。

class MyStruct {
public:
void function(){}
int member;
 

};