473,408 Members | 2,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Objects

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
6 2311


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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: dasod | last post by:
I would like to know if my method to remove list objects is correct in this small test program. It seems to me that there might be a simplier way, but I'm afraid I don't know enough about list...
9
by: Aguilar, James | last post by:
Hey guys. A new question: I want to use an STL libarary to hold a bunch of objects I create. Actually, it will hold references to the objects, but that's beside the point, for the most part. ...
6
by: Alfonso Morra | last post by:
I have written the following code, to test the concept of storing objects in a vector. I encounter two run time errors: 1). myClass gets destructed when pushed onto the vector 2). Prog throws a...
3
by: ytrewq | last post by:
Should dynamic ("expando") properties be restricted to native and user-defined objects? Or should host objects - such as references to the browser or a plug-in or to the document and its elements -...
8
by: Lüpher Cypher | last post by:
Hi, Suppose we have a hierarchical class structure that looks something like this: Object | +-- Main | +-- Object1
161
by: KraftDiner | last post by:
I was under the assumption that everything in python was a refrence... so if I code this: lst = for i in lst: if i==2: i = 4 print lst I though the contents of lst would be modified.....
7
by: Jo | last post by:
Hi, How can i differentiate between static and dynamic allocated objects? For example: void SomeFunction1() { CObject *objectp = new CObject; CObject object;
21
by: George Exarchakos | last post by:
Hi everyone, I'd like your help... Can we have a std::list<BASEwhere BASE be the base class of a class hierarchy? I want to add to this list objects that are inherited from BASE class but not...
27
by: SasQ | last post by:
Hello. I wonder if literal constants are objects, or they're only "naked" values not contained in any object? I have read that literal constants may not to be allocated by the compiler. If the...
14
by: Jess | last post by:
Hello, I learned that there are five kinds of static objects, namely 1. global objects 2. object defined in namespace scope 3. object declared static instead classes 4. objects declared...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.