abe*_*nky 10
是.以下是声明,实现和使用的示例.
宣言
struct MyStruct
{
int m_Int_in_Struct;
class MyClass
{
public:
MyClass(); // default constructor
int m_Int_in_Class;
};
};
Run Code Online (Sandbox Code Playgroud)
履行
MyStruct::MyClass::MyClass() // Constructor Implementation
{
m_Int_in_Class = 5;
}
Run Code Online (Sandbox Code Playgroud)
用法
int main(int argc, char* argv[])
{
MyStruct::MyClass* newObject = new MyStruct::MyClass();
newObject->m_Int_in_Class = 10;
}
Run Code Online (Sandbox Code Playgroud)
希望这能回答你的问题.
| 归档时间: |
|
| 查看次数: |
354 次 |
| 最近记录: |