objects and variables (was: some personal rambling on java the lang)

S

Stefan Ram

Keith Thompson said:
(Note that the C++ standard's definition of "object" is very similar
to C's; a C++ "object" isn't necessarily of some class type.)

However, just with regard to the type, C++ might have a
different concept of an object, because its specification
contains the sentence:

»An object has a type (3.9).«

1.8 »The C++ object model«, in: ISO/IEC 14882:2003(E)

This might be read to mean that /every/ object in C++ has a
type (of course, this is not necessarily a class type).
That's a perfectly reasonable definition of the word "variable", but the
C standard doesn't define or use the term.

It does not define, but it uses the term.

(ISO/IEC 9899:1999 (E) gives »ISO/IEC 2382-1:1993,
Information technology -- Vocabulary -- Part 1: Fundamental
terms.« as a normative reference. ISO/IEC 2382-1 indeed
defines »variable«, but in part 15, not in part 1:

»A quadruple, established by a declaration or an
implicit declaration, that consists of an identifier, a
set of data attributes, one or more addresses, and data
values, where the relationship between the addresses and
the data values may vary.«)

Regarding variables, C++ says:

»A variable is introduced by the declaration of an
object. The variable's name denotes the object.«

Oops, now I lost my self control and forgot that I DO
NOT KNOW C++, when posting to comp.lang.c. However, I
modified the Newsgroups header once again (see there).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top