Re: void vs void* (philosophical question)
- From: "Thomas J. Gritzan" <Phygon_ANTISPAM@xxxxxx>
- Date: Fri, 30 Jun 2006 17:05:34 +0200
Giannis Papadopoulos schrieb:
According to the standard (ISO C99 draft WG14/N1124), void is the
incomplete type that cannot be completed and comprises the empty set of
values. Since it declares the absense of a value can it be considered a
data type?
Regarding void*, is it just a simple reuse of the same keyword (void) or
they have a closer relationship? I could think of only one - a pointer
to an incomplete type. However, if one could say that void is the
absense of a value, how can we have a pointer to something that does not
exist?
Its logical if you think about it in terms of set theorie.
Think of two structs:
struct person
{
char* name;
};
struct worker
{
char* name;
char* job;
};
A pointer person* can point to a struct person and to a struct worker,
so it is a pointer to "at least a person".
A void* is a pointer to "at least nothing", so it can't point to
effectively everything.
Thomas
.
- References:
- void vs void* (philosophical question)
- From: Giannis Papadopoulos
- void vs void* (philosophical question)
- Prev by Date: Safe use of unions
- Next by Date: Re: new/delete
- Previous by thread: Re: void vs void* (philosophical question)
- Next by thread: Re: void vs void* (philosophical question)
- Index(es):
Relevant Pages
|