本文介绍了关于对象的认识的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好...

我是C ++的新手,并且了解什么知识.我知道
每个类都需要一个对象来访问该类的所有成员和成员函数.为什么类本身不直接调用成员函数?
所以,任何人都可以说为什么我们需要创建一个对象吗?

谢谢您

Hi Everyone......

I am novice in C++ and what to gain some knowledge.I came to know that
every class needs an object to access all members and member functions of that class.Why not member functions directly called by class itself ???

So, can any one say why we need to create an object???

Thanking You

推荐答案


CString myString;



CString是类. myString是对象.

也可以说myString是CString类型的变量.



CString is the class. myString is the object.

it''s also valid to say that myString is a variable of type CString.



这篇关于关于对象的认识的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-25 23:53