现在的位置: 首页 > 综合 > 正文

C++对象模型

2018年05月08日 ⁄ 综合 ⁄ 共 386字 ⁄ 字号 评论关闭

今天在酷壳网上看到的,保存下来收藏之

---------------------------------分割线----------------------------------------------

#include <iostream>
#include <string>

class A
{
public:
	void hello(const std::string& name)
	{
		std::cout << "Hello, " << name << std::endl;
	}
};

int main(int argc, char* argv[])
{
	A* pA = NULL;
	pA->hello("Tom");
	return 0;
}

---------------------------------分割线----------------------------------------------

上面这段代码没有问题,可以正常运行。

抱歉!评论已关闭.