473,854 Members | 1,476 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 8881
Roose wrote:
I find it _extremely_ irritating when people complain about
top-posting, as if they were the President of UseNet.
Even after a decade or more reading it.


I never get any of those type of complaints.
Have you ever considered that there might be
an obvious, easy, and final, solution to your problem ?

--
pete
Nov 13 '05 #81
Roose <no****@nospam. nospam> wrote:
Thanks, but at this point, it's just entertainment. No big deal. Pretty
much half the newsgroup has be vehemently replying to this thread, so I'll
take that as a license to continue. But you're right that I would have got
bored if they stopped replying.


Good point. At least while they continue spending time with you, they
are not bothering other people with their prattle.

--
Nov 13 '05 #82
Mark McIntyre wrote:
Then you're behaving like an antisocial cretin who deserves to be
ostracised by your fellows.


ROFLMAO! What's so funny is the manifest inability of you folks
to do just that!

I just *love* these threads where the clcnicks get their knickers
all bunched up.

Oop, darn forgot to post this in HTML....

--
|_ CJSonnack <Ch***@Sonnack. com> _____________| How's my programming? |
|_ http://www.Sonnack.com/ _______________ ____| Call: 1-800-DEV-NULL |
|______________ _______________ _______________ _|_____________ __________|
Nov 13 '05 #83
Roose wrote:
The issue is not top-posting: the issue is continued rudeness
towards a group in which you are currently a *guest*.
And about the rudeness, it seems to be one of the accepted norms
in this group.


Actually, in many comp.lang groups. (Heh, actually, in *many*
places in amUSENET.)

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.

"HTML has a "T" and that stands for Trouble!..." ;-)

The rudeness also serves the purpose of showing everyone what
hypocrites they are.
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!)

If they consider me a troll, then they should follow netiquette
and killfile _without comment_.


Where's the fun in that? The public plonking serves to demonstrate
how superior they (think they) are to you.
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.

--
|_ CJSonnack <Ch***@Sonnack. com> _____________| How's my programming? |
|_ http://www.Sonnack.com/ _______________ ____| Call: 1-800-DEV-NULL |
|______________ _______________ _______________ _|_____________ __________|
Nov 13 '05 #84
In article <3F************ ***@Sonnack.com >,
Programmer Dude <Ch***@Sonnack. com> wrote:
"HTML has a "T" and that stands for Trouble!..." ;-)
No, the T stands for Text, and we have no problem with that part.
It's the H and the M (especially the M) that we'd rather not have to
deal with.

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, the number of chances that they would get to change their position
before I stopped being polite about it would not be large.

If it were my teeth that were being picked up as a result of such an
exchange, the other party would have rather more than just teeth to be
worrying about.

(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.)

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.


Better would be to grow a thick skin and pay attention to people when
they're telling you something.
Even better would be to not be rude when people try to tell you things
in the first place. (I sometimes wonder whether I have some sort of
attitude problem, since I've never noticed any of the regulars (or pretty
much anybody else, for that matter) being rude to me.)
dave

--
Dave Vandervies dj******@csclub .uwaterloo.ca
Yes, I'm a middle-aged fogy. Forty years ago I was a young fogy.
In fifteen years or so, I'll be an old fogy.
--Mike Andrews in the scary devil monastery
Nov 13 '05 #85
Dave Vandervies wrote:
"HTML has a "T" and that stands for Trouble!..." ;-)
No, the T stands for Text,...


Not a fan of old musicals? (-:

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.

(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.)

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.


Better would be to grow a thick skin and pay attention to people
when they're telling you something.


Only if that something is (a) something I care to know and (b) is
something the other party can speak authoritatively and correctly
about. Unasked for *opinions* about how I should behave are not
particularly welcome.
Even better would be to not be rude when people try to tell you
things in the first place.


Considering that unasked for advice is a rudeness in itself, I'd
suggest it was the offerer of said advice who "started it".
It's about control. The more I think about life and people, the
more I realize there is a single, almost defining, characteristic
about humans: we try to control as much of our environment as we
can. Some people more so than others. Some *way* more so than
others. Most of Maslow boils down to this single issue, IMO.

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.

--
|_ CJSonnack <Ch***@Sonnack. com> _____________| How's my programming? |
|_ http://www.Sonnack.com/ _______________ ____| Call: 1-800-DEV-NULL |
|______________ _______________ _______________ _|_____________ __________|
Nov 13 '05 #86
Dave Vandervies <dj******@csclu b.uwaterloo.ca> wrote:
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,


There is only a single social norm that I care about or believe to be
important.

Is what the person doing causing direct harm to my property (a person
fundamentally owns themselves), without my consent?

If the answer is no, they, quite simply, can do whatever they feel like
doing.

Of course, since everyone has these same property rights, actions people
can take are not unlimited.

No rational person can argue that a post to USENET is causing direct
harm to anyone's property, without their consent. This is a public place
and no one is forced to be here.

--
Nov 13 '05 #87
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, which Jack Klein gave him. I
don't suppose he wanted to hear incorrect answers.
Really. Just a reality check here.
I want to know what kind of people I'm dealing with here.


Most people who stick this newsgroup for any length of time tend to be the
kind of people who value accurate answers.

--
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 #88
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 #89
Programmer Dude <Ch***@Sonnack. com> writes:
[...]
The extreme focus on text of a certain width, no HTML, specific
rules about quoting and replying.... all control mechanisms.


These are all serious attempts to keep this newsgroup useful. We have
found, from years of experience, that folowing certain simple
conventions makes this whole thing possible. Excessively long lines,
HTML, and putting quoted material after the response all get in the
way of communication. Most of us realize that, even if following the
conventions might take a little more time, it's well worth it to make
things a little easier for the people reading what we write.

I seldom say anything so important that it's going to be worth my
readers' time to wade through clever formatting or insufficient
context to figure out what I'm talking about. Even if I did have
something monumental to say, I'd still want to make it as easy as
possible for it to be read.

Too many newsgroups have descended into useless chaos. We don't want
to let that happen to comp.lang.c.

We're here to talk about C. Anyone who's more interested in showing
off how unconventional they are, or how creatively they can format
their text, should probably consider finding someplace else to do it.

--
Keith Thompson (The_Other_Keit h) ks*@cts.com <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://www.sdsc.edu/~kst>
Schroedinger does Shakespeare: "To be *and* not to be"
Nov 13 '05 #90

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.