Re: Objects

From: Robert Fortune (
Date: 11/06/03

Date: Thu, 06 Nov 2003 10:23:21 GMT

"Robert Fortune" <> wrote in message
> news:EFeqb.11550$

> > Is an object a class and a class an object?

Mike Wahler" <> wrote in message

> No.
> A 'class' defines a data type. An object is
> an instance of a type.
> int i; /* defines an instance (an object) of type 'int', named 'i' */
> class X /* defines the type 'X' */
> {
> int member;
> };
> X obj; /* defines an instance (an object) of type 'X', named 'obj'
> What C++ book(s) are you reading?

Thanks again everyone for your answers. You make this
group great!

   Sams Teach Yourself C++ Programming in 21 days by
Jesse Liberty. I like this book. It's helping me get my foot
in the door. Aside from this it's really a good book.

   What's confusing:

 "A Class is just a collection of variables -- often of different types --
combined with a set of related functions."

Ok. I follow that. (and old QB programmer here)


  "A Class enables you to encapsulate, or bundle, these
various parts and various functions into one collection, which is called an

He seems to be saying that a collection of data members
and related functions is an object as well as a class.