By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,808 Members | 1,477 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,808 IT Pros & Developers. It's quick & easy.

Objects

P: n/a
Hi

After reading alot of literature on C++ i have failed to find a
reasonable definition of a class and an object, could someone provide these?

Jul 19 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a


Karl Heinz Buchegger wrote:

Danny wrote:

Hi

After reading alot of literature on C++ i have failed to find a
reasonable definition of a class and an object, could someone provide these?
If you read some literature, then surely you have some specific questions
instead of the global one. The point is: talking about classes and objects,
how to use them, what to do with them is a fairly lengthy topic.


Forget this part. I misread your question the first time.

A class is a 'declaration'. A blueprint: what should an object of that type
look like. What data does it hold, what methods (function calls) does it
understand and react on.

An object is an 'instance' of a class. While the class declaration is just
a blueprint, the object is the real thing.


--
Karl Heinz Buchegger
kb******@gascad.at
Jul 19 '05 #2

P: n/a
Danny wrote:
After reading alot of literature on C++,
I have failed to find
a reasonable definition of a class and an object,
could someone provide these?


In the context of the C++ computer programming language,
a class (struct) is a User Defined Type (UDT) and
an object is an instance of type --
either a built-in type or a UDT.

Jul 19 '05 #3

P: n/a
On Fri, 08 Aug 2003 09:48:31 -0700, "E. Robert Tisdale"
<E.**************@jpl.nasa.gov> wrote in comp.lang.c++:
Danny wrote:
After reading alot of literature on C++,
I have failed to find
a reasonable definition of a class and an object,
could someone provide these?


In the context of the C++ computer programming language,
a class (struct) is a User Defined Type (UDT) and
an object is an instance of type --
either a built-in type or a UDT.


Close, but no cigar...
The word has an exact, precise, and specific definition in the ISO C++
standard:

1.8 The C++ object model

"An object is a region of storage."

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++ ftp://snurse-l.org/pub/acllc-c++/faq

Jul 19 '05 #4

P: n/a
Jack Klein wrote:
The word has an exact, precise, and specific definition in the ISO C++
standard:

1.8 The C++ object model

"An object is a region of storage."


It's more *specific* but I'm not so sure that it's *precise*.
It seems to indicate that objects are *data objects*
in the context of a C++ program but objects may exist
even if no storage is actually allocated for them.
For example, objects declared to hold temporary intermediate values
may be elided:

double work(double mass, double acceleration, double distance) {
float_t force = mass*acceleration;
return force*distance;
}


Jul 19 '05 #5

P: n/a
Jack Klein wrote:
The word has an exact, precise, and specific definition in the ISO C++
standard:

1.8 The C++ object model

"An object is a region of storage."


It's more *specific* but I'm not so sure that it's *precise*.
It seems to indicate that objects are *data objects*
in the context of a C++ program but objects may exist
even if no storage is actually allocated for them.
For example, objects declared to hold temporary intermediate values
may be elided:

double work(double mass, double acceleration, double distance) {
float_t force = mass*acceleration;
return force*distance;
}


Jul 19 '05 #6

P: n/a
The use of terminology is not always consistent. A class describes an
object and than the description (the class) is used to construct the
object. A class is like a mold used for making objects.

"Danny" <da***********@ntlworld.com> wrote in message
news:3F**************@ntlworld.com...
Hi

After reading alot of literature on C++ i have failed to find a
reasonable definition of a class and an object, could someone provide these?

Jul 19 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.