N
Nick Keighley
please leave attributions in
this is a daft analogy. structs do not incur a name lookup at
run time. arrays and structs address different problems. If
I want to lookup infomation about the 7th transceiver then I
use an array.
no. Your analogy is broken.
never.
If you want a struct, then use a struct!
I don't see the problem
sorry I don't understand that
this is gibberish. What is a "lay-user"? In what circumstances is an
array more efficient than a struct? I find sequential numbers easy to
remember. Use arrays when you want a series of entries of identical
type and semantics. Use structs when the type or semantics of the
contained items is disparate.
*do you remember IP addressess or names of sites* ?
this is a daft analogy. structs do not incur a name lookup at
run time. arrays and structs address different problems. If
I want to lookup infomation about the 7th transceiver then I
use an array.
in this context array is more efficient.
no. Your analogy is broken.
when was the last time you used indexes to get the members of a struct like
this:
switch(i) {
case 0: {
/* access first member */
int i = s1.m1;
break;
}
case 1: {
int i = s1.m2;
}
default: {
/* struct does not have such a member */
}
}
never.
If you want a struct, then use a struct!
the problem is: to provide the user *names* instead of indxes.
I don't see the problem
but a lot can. So called packed structs cannot even be implemented on
some architectures. What "problem" does a "packed struct" solve? You could
you use portable C to pack and unpack structs if you really need to save
space.
im aware. but a packed struct will all similar elements can be (AFAIK)
sorry I don't understand that