473,839 Members | 1,532 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Asking if elements in struct arre zero

If I have:

struct one_{
unsigned int one_1;
unsigned short one_2;
unsigned short one_3;
};

struct two_{
unsigned int two_1;
unsigned short two_2;
unsigned char two_3;
};

struct mystruct{
struct one_ one;
struct two_ two;
}mystruct1;

Then could I by any change ask on the value of the whole struct mystruct1,
that is all the elements in the struct in one call? I want to do something
like (in pseudo like language):

if(mystruct1 == 0) { print("All elements of mystruct1 is zero");}
Best Regards
Terry
Nov 13 '05
258 8834
I almost forgot, thanks for so graciously admitting you're a hypocrite by
replying.

Or do you want to retract your request for me not to top-post? You can
change your mind, I'll understand.

"Richard Heathfield" <do******@addre ss.co.uk.invali d> wrote in message
news:bn******** **@sparta.btint ernet.com...
Roose wrote:

<snip>
> Prove that I did not post here. If you understood how Usenet works,
> you would not be able to say that my claim is false.

You, Roose, have posted to this newsgroup in exactly one thread - this one.
My supporting evidence is the Google archive.

Are you claiming that Google has lost your articles?


Jesus Christ. I think this is like the 3rd time I've explained this.
Let's go back to the basics.


By all means.
There is the real world, and then there is the Internet. In the real
world,
there is a person that exists. On the Internet, that person can have AS
MANY USENET IDENTITIES AS HE WISHES. It's fascinating, I know.


In Usenet, it is effectively the case that you are what you post. As far

as the world can tell, your identity is "Roose" and the only articles you have posted in this newsgroup have all been made within the last few days.
Therefore, the fact that "Roose" (NOT my real name, BTW) only appears in
certain threads, does not mean that I (a real person) have never posted in other threads.
Nor does it mean the opposite. In the absence of evidence to the contrary
after a search of the archives for the existence of such evidence, I draw
the obvious conclusion that you, Roose, have never posted here before.
You're making this way too easy for me.


Well, I'm certainly trying to make it as easy for you as I can. You have
made a claim (i.e. that you have posted in this newsgroup as long ago as
1995) which you have failed to substantiate. I don't believe your claim.

If you care about your reputation, either substantiate your claim (for
example, giving a message ID from a 1995 article you posted to comp.lang.c, together with some kind of evidence that the article in question was indeed posted by you), or withdraw the claim.

It's that easy.

--
Richard Heathfield : bi****@eton.pow ernet.co.uk
"Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
K&R answers, C books, etc: http://users.powernet.co.uk/eton

Nov 13 '05 #101
"Richard Heathfield" <do******@addre ss.co.uk.invali d> wrote in message
news:bn******** **@titan.btinte rnet.com...
Roose wrote:
Alas, Roose has started dispensing C "advice".


Honestly. In all seriousness.

Do you think the OP (in the interview question thread) wants to hear what I
told him, or what you guys told him?


I presume he wants to hear the right answer


Let me dispatch this one with cut and paste from my previous posts, short on
time now:

"The correct answer is what the interviewer wants to hear. Take a step
back from your insular little world of the C standard as a bible, and look
at the larger problem. Getting a job. In an interview, you would be the
guy that refuses to acknowledge this practical fact, unpure as it may be.
The guy who shows he knows how a stack works will be the one who gets a job.
A perfect example of why my "underemplo yed" flame was, again, witheringly
accurate."

"I find it hilarious that you live in such a regimented, literal-minded
world"

This also demonstrates my recently added stereotype:

"- inability to distinguish between the real world and the insular little
world of Usenet"

Which answer do you think would help the interviewee get the job? Which
answer demonstrates knowledge/ability to work on *real* projects?

1) No, there's no ANSI C standard way to do that <and say nothing else>
2) A non-portable way is... <what I said>
Nov 13 '05 #102
The extreme focus on text of a certain width, no HTML, specific
rules about quoting and replying.... all control mechanisms.


Yes! Thanks for the text width, I forgot about that one. Let's all create
line breaks at 78 characters, yes? Well, let's get the "regulars" to agree
first, and then after that of course everyone must follow suit.

Nov 13 '05 #103
> But they're quite a scrabbly lot here, aren't they. They remind
me of small town folk fighting to keep progress out of River City.
Thanks, that is what I've been trying to get at. I was amused, but now I
think it's sad. Basically my take on it is that there _was_ a newsgroup for
all people to discuss the C language, and it's been ruined. Gradually, a
mass of geeks with the same obsessive-compulsive tendencies gravitated
here -- driving out everyone else with their "comic book guy from the
Simpsons" act, constant harping about trivial things, obsessive focus on the
ANSI C standards, rather than the C language in the real world.

What boggles the mind is even after I pointed out all these things, they
continue to exhibit no self-awareness and demonstrate the same close-minded
tendencies, like in the interview question thread.
I've always thought it had to do with insecure egos. A common
phenomenon: if you can trash something, you *must* be better than
it. There is also the common phenomenon of "keyboard disconnect".
It's easy to be a jerk when you're not face to face. I'd bet good
money most of these people wouldn't **dare** to talk like that to
anyone's face. (If they talked to me like that, they'd be picking
up teeth!)
Yeah, it's pretty transparent.
All kidding aside, my sense is there is *vast* knowledge about the
C language to be had here. But you should largely ignore them in
any other subject.


That's my assessment too, and I have never doubted them on that. But
knowledge of the C language standard doesn't necessarily imply success at
building real systems.

Roose
Nov 13 '05 #104
Roose wrote:

"Richard Heathfield" <do******@addre ss.co.uk.invali d> wrote in message
news:bn******** **@sparta.btint ernet.com...
In Usenet, it is effectively the case that you are what you post.
As far as the world can tell, your identity is "Roose" and the only
articles you have posted in this newsgroup have all been made within
the last few days.

<snip>
Let's repeat. "Roose" is not a real person.
I guessed as much. Therefore, any article purporting to be from "Roose" is a
forgery, and should under no circumstances be taken seriously. Certainly no
C advice should be accepted from a non-existent person.
I, Andy, am a real person.
Don't call me Andy. It's not my name. And we know it's not /your/ name,
because your name is Roose, and - by your own admission - you don't exist.
Roose has not posted here before, but I have.
You /are/ Roose, and Roose doesn't exist, remember?
It is not possible to prove that I posted here.


I can easily prove that I've posted here, however - I don't think I would
have the slightest difficulty persuading, say, a court of law of that fact
if it were ever to prove necessary for some bizarre reason.

Since you can't provide proof, I can only draw the obvious conclusion.

<snip>

--
Richard Heathfield : bi****@eton.pow ernet.co.uk
"Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
K&R answers, C books, etc: http://users.powernet.co.uk/eton
Nov 13 '05 #105
In article <3F************ ***@Sonnack.com >,
Programmer Dude <Ch***@Sonnack. com> wrote:
There is also the common phenomenon of "keyboard disconnect".
It's easy to be a jerk when you're not face to face. I'd bet good
money most of these people wouldn't **dare** to talk like that to
anyone's face.


Funny you should mention that...
There's a coffee shop near where I live at which I often get together
with a few friends and acquaintances to drink coffee and talk about
flurzling with beebles. Since we're there quite a bit, a bunch of
students and random passers-by sometimes see us there and come over
and ask questions (often related to homework the students who study
beeble theory are doing), or just pull up a chair and listen (since
beeble theory, and flurzling in general, can lead to discussions that
are quite interesting once you understand the basics). It works quite
nicely; the coffee shop provides a convenient place where we can show up
or not show up, depending on whether we have the spare time, and with a
convenient combination of a public place and implicit boundaries that
lets us carry on a discussion independently of the people at the next
table but still doesn't make us seem too threatening to people who want
to join us. Even the management of the coffee shop likes us, because we
buy a lot of coffee, and sometimes people will even come in just to ask
us a question and buy coffee while they're there (even though nowadays
most people seem to prefer going to bars and spending their money on beer
while carrying on superficial conversations with drunk people instead
of talking to a few stuffy old intellectuals in a coffee shop).

There are a few other groups of people who accumulate in the same
coffee shop and discuss similar topics, like flurzling with bobbles,
or general flurzle theory, or even unrelated and mundane things like
playing guitar and programming computers. (One of the nice things
about living in a city with two universities is that you can discuss
pretty much anything in a coffee shop without people thinking you're
weird because you care about something like the political structure
of medieval yak herds, which apparently The Rest Of The World thinks
is pretty obscure.) There are even some people who discuss flurzling
with either beebles or bobbles (or even any of flurzling with beebles,
flurzling with bobbles, playing guitar, and the political structure of
medieval yak herds), depending on which discussion looks liveliest when
they come in. Sometimes students will hear us discussing flurzling with
beebles and ask us a question about flurzling with bobbles; since a lot
of the underlying math is pretty similar between beeble theory and bobble
theory, we can usually give them a reasonable answer to their questions,
but (especially if their question is about an area where the two theories
are different) we'll tell them that they'll get better answers from the
people who discuss flurzling with bobbles. Sometimes we even end up
comparing some of the finer points of the two theories, and often when
that happens a few people from one table will drop in and visit the other
table to compare notes. Those discussions are always the liveliest, and
(when they don't degenerate into arguments about which theory is more
useful and why or confusion over which theory we're talking about)
often shed light on some interesting ways of borrowing some ideas
(or even some parts of the theory) from one theory and using them to
simplify something in the other theory.

Last Sunday, somebody asked how to determine whether a sub-beeble was
isomorphic to a null space of a beeble field, and after some discussion
somebody pointed out that there was a way to generate a null space of
the correct order as a constant in the equations, and that once you
have that it's easy (almost, but not quite, trivial, even) to determine
whether the sub-beeble is isomorphic to that.

About five minutes after that result came up, somebody who had been
listening to us spoke up and said "Hi, I'm Ruth. Is the ability to use
a null space of an arbitrary order a recent development? I haven't
heard of it before." After a few minutes of collective "Huh?"-type
confusion, Rick (one of the people who's best at answering basic student
questions) realized that the question was referring to the discussion
of determining whether sub-beebles were isomorphic to null spaces, and
said that generating a null space of the right order had been possible
for a while, but being able to pull one out of the air when you needed
one was a recent development from a paper that Professor Stan Komtee had
published only a few years ago and that introduced several new concepts
that hadn't been widely adopted for flurzling yet. He (Rick) also
told Ruth that, since the discussion tends to jump around quite a bit
(and there's often more than one discussion going on at the same time),
it's a good idea for people who are returning to something that had been
discussed before to remind us of what we had said that was relevant to
their question or comment.

Ruth didn't seem to like that last bit much; she said that she liked
it better that way, and that it was annoying when people insisted in
refreshing everybody else's memory about what had been said five minutes
ago (or even two minutes, or even thirty seconds), and even more annoying
when people complained about her jumping into things without giving
enough cues to them about what she was talking about. When Rick (and a
few others) pointed out that, because of the number of different things
that got discussed in a typical two minutes of discussion, questions
without context were difficult to make sense of and that often the people
who gave the best answers just gave up trying to make sense of people
who did it often, she just said that if that was the case then people
should just ignore her, and that anybody with a short-term memory should
be able to remember what was said thirty seconds ago anyways.

For some reason, though, instead of acknowledging that following the
conventions that we had established to make it easier for everybody
would get better answers, Ruth just started yelling at us that if we
were going to ignore her, then, well, why weren't we ignoring her, and
why didn't we shut up and stop trying to make her aware of how best to
get good answers, since she obviously didn't want to know?

At this point, Rick asked her why, if she didn't want us to pay attention
to her anyways, she didn't just go away and stop yelling at us to ignore
her. At this point I doubt it would come as a surprise to you that she
neither did so nor provided a good reason why not. Instead she said that,
if everybody at the table (even the people who had been distracted from a
really interesting discussion about how to keep track of sub-beebles that
needed to be introduced into equations and making sure that they were all
accounted for) when she started shouting, could just remember what she had
been talking about before that, then they would OBVIOUSLY know that she
was only talking about being ignored by people who wanted her to provide
some context for comments she made, and that the people who wanted her
to provide context were obviously just narrow-minded control freaks who
wanted to make everybody conform to their idea of what was a good way to
make it easy to keep track of a technical discussion with a large group
in a public space, and that people who wanted to be able to keep track
of what was going on without spending half of their time reviewing what
they had been discussing before must be really fun to talk to at parties.

After a little bit more back-and-forth about why it was a Bad Thing to
ignore the conventions of groups she was dealing with, and especially
why it was a Very Bad Thing to be as rude as she was while doing so,
Ruth started pointing out that since we were in a public place, she could
do whatever she wanted to while she was talking to us, and that we were
being idiots for trying to be reasonable with somebody who obviously
wanted to make an idiot of herself by being rude to us.

At this point a few masochists began pointing out that despite the
fact that we were in a public place with no formal rules of conduct,
it was still expected that people would show decency and respect while
dealing with others, and that deliberately failing to observe the norms
and protocols of a group of people you had just joined was not exactly
what most people would consider showing decency and respect.

Ruth's response to this, I'm sure, will come as a surprise to nobody:
she kept yelling at us about how it was so cool to be able to get people
annoyed with her just by being rude to them, and that the people who were
trying to get her to either stop being rude to us or to just go away were
obviously making the problem worse by trying to get her to be reasonable.
More interesting was the fact that it was about then that somebody came
by and started telling the combatants that they really should be nice to
the poor innocent newcomer, and that really, if people were as rude to
him as they were being to Ruth, they'd be picking up their teeth by now.

This was when I started wishing that we were having this discussion
someplace sane, like usenet, so I could just killfile the thread or go
find something else to waste time on for a while when I got tired of it...

dave

--
Dave Vandervies dj******@csclub .uwaterloo.ca
[i]t is to be understood that accusing a perfect stranger of being a smartass,
primadonna or of lacking social graces is an example of impeccable manners.
--Kaz Kylheku roasts a troll in comp.lang.c
Nov 13 '05 #106
Roose wrote:
I almost forgot, thanks for so graciously admitting you're a hypocrite by
replying.


To whom is this addressed? Please include relevant context above your reply,
so that we know what on earth you are talking about. Thanks.

--
Richard Heathfield : bi****@eton.pow ernet.co.uk
"Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
K&R answers, C books, etc: http://users.powernet.co.uk/eton
Nov 13 '05 #107
Roose wrote:
"Richard Heathfield" <do******@addre ss.co.uk.invali d> wrote in message
news:bn******** **@titan.btinte rnet.com...
Roose wrote:
>> Alas, Roose has started dispensing C "advice".
>
> Honestly. In all seriousness.
>
> Do you think the OP (in the interview question thread) wants
> to hear what I told him, or what you guys told him?
I presume he wants to hear the right answer


Let me dispatch this one with cut and paste from my previous posts,
short on time now:

"The correct answer is what the interviewer wants to hear.


Right, and that's why the correct answer is the answer you should give. The
incorrect answer will displease the interviewer. For example, waffling on
about stacks.
ake a step
back from your insular little world of the C standard as a bible,
Well, it's actually a PDF document. In this newsgroup, standard C is what we
discuss. My interests, knowledge and experience encompass more than this
newsgroup but, whilst I am participating in this newsgroup, I discuss
standard C. That is because I respect the conventions of this
well-established newsgroup. Your unwillingness to do this says a lot more
about your insularity than it does about mine.
and look
at the larger problem. Getting a job. In an interview, you would be the
guy that refuses to acknowledge this practical fact, unpure as it may be.


On the contrary, I would be the guy who said: "the correct answer is that
this can't be done in a well-defined way, but there are some very
non-portable hacks that take advantage of the way some compilers lay out
memory - did you want to hear about those?"

If, at that point, the interviewer says "yes", then I can proceed to tell
him about the non-portable hacks (which are off-topic in comp.lang.c), and
if he says "no" I saved us both some time and may well have landed the job
in the process.

--
Richard Heathfield : bi****@eton.pow ernet.co.uk
"Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
K&R answers, C books, etc: http://users.powernet.co.uk/eton
Nov 13 '05 #108
In article <3F************ ***@Sonnack.com >,
Programmer Dude <Ch***@Sonnack. com> wrote:
Dave Vandervies wrote:
There is also the common phenomenon of "keyboard disconnect".
It's easy to be a jerk when you're not face to face. I'd bet good
money most of these people wouldn't **dare** to talk like that to
anyone's face. (If they talked to me like that, they'd be picking
up teeth!)


If somebody were to tell me face to face that I was an idiot for
preferring that they follow established social norms when dealing
with me,...


Something I would grant you the ability to do *only* within the
context of *your* home or *your* office. On public ground you
have *zero* right (repeat: Z*E*R*O) to expect or demand anything.

You can certainly *request*, and if you do so nicely, and if all
other things are equal, I may well grant your request. If your
ego is so overwhelming that you refuse to deal with me, except by
your guidelines, then you probably are someone I could get through
life without dealing with ever.


[If you haven't read the post I just made a little bit upthread, go read
it now and come back to this one.]
You're really prepared to claim that Ruth's conduct was acceptable,
and that the other people sitting at the table were wrong to object to it?

If you are, I'm glad I don't live in your world.
If you aren't, I'm curious about who would be picking up whose teeth and
at what point. I suspect that the answer doesn't support the position
you appear to be taking here.

(And yes, in the small subset of the real world that I prefer to
inhabit, telling people (usually without being all that diplomatic
about it) when they're wrong or when they should go away and bother
somebody else instead is expected according to the established
social norms.)


I would consider your social norms defective or naive. (Not an
uncommon thing for hardcore computer workers and engineers.) I
forget who said it, but "Politeness is the grease on which society
runs" is, I think, a Truth.

(If those are indeed your social norms, I can see why you prefer
to inhabit a small subset of the real world.)


No, those are not "my" social norms; they are the social norms of the
subset of the world that I prefer to inhabit.
In the larger subset of the world that I do in fact inhabit, there are
several subsubsets, a few of which are also subsubsets of the subset
that I prefer to inhabit. Social norms are defined by the social group
whose norms they are, not by an individual member of that social group.
When I'm with nontechnical people, I don't follow the same norms as when
I'm with technical people.

I've discovered that engineers and computer programmers are,
perhaps understandably, *extremely* controlling people. This is
good in their work, but can be a problem in social interaction.
They are also often prone to truly believe a problem has only
ONE completely valid solution (another aspect of control).

The extreme focus on text of a certain width, no HTML, specific
rules about quoting and replying.... all control mechanisms.

SOME of us prefer a wilder, less controlled, version of reality.
Some of us also don't much care to *be* controlled.


Some of us realize that it's better to conform in areas that make it
easier to understand each other, and to leave the nonconformism to areas
where it improves things instead of just making everybody work harder.
dave

--
Dave Vandervies dj******@csclub .uwaterloo.ca
I would expand on these points here, only I don't really have the time
right now to copy out five pages of text.
--Richard Heathfield in comp.lang.c
Nov 13 '05 #109
> > Let's repeat. "Roose" is not a real person.

I guessed as much. Therefore, any article purporting to be from "Roose" is a forgery, and should under no circumstances be taken seriously. Certainly no C advice should be accepted from a non-existent person.
I, Andy, am a real person.


Don't call me Andy. It's not my name. And we know it's not /your/ name,
because your name is Roose, and - by your own admission - you don't exist.
Roose has not posted here before, but I have.


You /are/ Roose, and Roose doesn't exist, remember?


Now you're just embarassing yourself.

Wow. I drove Richard utterly insane. It doesn't take much, I guess.

... "brittle personality" ...

Hm, I keep hearing echoes of my old posts.

Keep going Richard. You've almost bored me to death with this desperate
struggle. I'll stop when I'm completely bored.

Weird, since at first I thought you were _definitely_ smarter than Mr. Hu or
Mr. McIntyre. I'm usually a pretty good judge of character at first.
Nov 13 '05 #110

This thread has been closed and replies have been disabled. Please start a new discussion.

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.