D
Dan Pop
In said:void is an incomplete type, not an object type.
No one said it's an object type, but a valid, non-null void pointer
value can only be pointing to an object. Hence the weirdness of void.
Dan
In said:void is an incomplete type, not an object type.
Merrill & Michele said:Those are "derived type," as others have mentioned.
But what about `short int', `long int', and `long double'?
And then there are the `unsigned' variants ... Despite
the multi-word names, these are in no sense "derived"
types. Finally there's `void' -- which might be excluded
from the ranks of "data types" by virtue of its weirdness.
My guess is that one needs to read a little more of
K&R's context to understand what they mean by "basic."
You'd be stuck reading tea leaves with the K&R context here. short, long,
signed and unsigned are mentioned along with the basic data declarations,
but I have yet to stumble across a sentence that says, "well folks, chp. 2
is long behind us, and we're going to nuance this discussion of type." And
please don't ask me why Mr. Sosman's comments don't have arrows on them.
MPJ
Don't underestimate my ability to be simultaneously mistaken and ignorant.
I'm due to spend another $50 on a C book. Since H&S is referenced in theJohn Bode said:"Merrill & Michele" <[email protected]> wrote in messageThose are "derived type," as others have mentioned.
But what about `short int', `long int', and `long double'?
And then there are the `unsigned' variants ... Despite
the multi-word names, these are in no sense "derived"
types. Finally there's `void' -- which might be excluded
from the ranks of "data types" by virtue of its weirdness.
My guess is that one needs to read a little more of
K&R's context to understand what they mean by "basic."
You'd be stuck reading tea leaves with the K&R context here. short, long,
signed and unsigned are mentioned along with the basic data declarations,
but I have yet to stumble across a sentence that says, "well folks, chp. 2
is long behind us, and we're going to nuance this discussion of type." And
please don't ask me why Mr. Sosman's comments don't have arrows on them.
MPJ
You might want to look at other references as well. My primary
reference is Harbison & Steele, and here's how they organize types:
Scalar Types
Arithmetic Types
Integral Types
short, int, long, long long (signed/unsigned)
char (signed/unsigned)
_Bool
enum {...}
Floating-point Types
float, double, long double
float _Complex, double _Complex, long double _Complex,
float _Imaginary, double _Imaginary,
long double _Imaginary
Pointer Types
T *
Aggregate Types
Array Types
T [...]
Structure Types
struct {...}
Union Types
union {...}
Function Types
T (...)
Void Type
void
H&S don't try to distinguish between "basic" and "derived" types, and
I'm not sure I could do so. I've never had to worry about it in the
past. I would imagine that enum, char, short, int, long, long long,
float, double, and long double are basic types; everything else
(pointers, arrays, structs, unions, etc.) is derived from those types.
Many people might find uncomfortable having one's shortcomings turned into aKevin D. Quitt said:ignorant.
Grabbed. Generalized to be M&M corollary of Sprague's law.
Sprague's Law:
"There are three orders of magnitude more dumbshits in the world than
there can be any use for." --William Sprague
Quitt's Clarification to Sprague's Law:
"Stupid isn't not being smart; stupid is not using one's smarts."
--Kevin D. Quitt
The M&M corollary of Sprague's law:
"Don't underestimate the ability to be simultaneously mistaken and
ignorant." --Merrill & Michele
In answer to "How can people be so stupid as to...":
"We all do what we're good at." --Kevin D. Quitt
--
#include <standard.disclaimer>
_
Kevin D Quitt USA 91387-4454 96.37% of all statistics are made up
Per the FCA, this address may not be added to any commercial mail list
Merrill & Michele said:Many people might find uncomfortable having one's shortcomings turned into a
"law." I like to think of it as being unafraid to leave my zone of comfort
to try a new dance. MPJ
Dan said:No one said it's an object type,
but a valid, non-null void pointer
value can only be pointing to an object. Hence the weirdness of void.
pete said:That's why I said it.
In said:That's why I said it.
OP listed some object types and mentioned their variants
and then mused about why void was different.
All pointers to incomplete types are like that.
Incomplete types don't have values and
pointers to incomplete types don't have arithmetic.
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.