1 Star 0 Fork 0

Admin / text_cpp

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
class_project2.cpp 408 Bytes
一键复制 编辑 原始数据 按行查看 历史
Admin 提交于 2024-04-19 22:48 . 类的使用,this指针
#include <iostream>
#include "class_project.h"
using namespace std;
void A::Init(int a)
{
_a = a;
}
void A::Printf()
{
cout << _a << endl;
cout << this->_a << endl;
}
class B
{
void Init();
};
class C
{
};
int main()
{
A arr1;
A arr2;
arr1.Init(1);
arr2.Init(2);
arr1.Printf();
arr2.Printf();
/*cout << sizeof(A) << endl;
cout << sizeof(B) << endl;
cout << sizeof(C) << endl;*/
return 0;
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/small-c_2_0/text_cpp.git
git@gitee.com:small-c_2_0/text_cpp.git
small-c_2_0
text_cpp
text_cpp
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891