473,805 Members | 1,958 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 8764
Mark McIntyre wrote:
Oop, darn forgot to post this in HTML....


<pedantry>
you misspelled oops
</pedantry>


Nah, 'twasn't big 'nuf for the "s". :-|

--
|_ CJSonnack <Ch***@Sonnack. com> _____________| How's my programming? |
|_ http://www.Sonnack.com/ _______________ ____| Call: 1-800-DEV-NULL |
|______________ _______________ _______________ _|_____________ __________|
Nov 13 '05 #121
Roose wrote:
Basically my take on it is that there _was_ a newsgroup for
all people to discuss the C language, and it's been ruined.
Oh, I would disagree. For "C-only" questions, this group is
unparalleled. You just have to understand the focus.
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.
Do you really believe you can illuminate, educate or enlighten
people on amUSENET? Wanna buy a bridge? (-:
But knowledge of the C language standard doesn't necessarily
imply success at building real systems.


No, but you will find professional working programmers here a
plenty with many successful real systems to their credit. If
you're interested in C, don't let the social behavior poison
the well. Even though the water sometimes has a rank smell,
it's actually pretty good water.

--
|_ CJSonnack <Ch***@Sonnack. com> _____________| How's my programming? |
|_ http://www.Sonnack.com/ _______________ ____| Call: 1-800-DEV-NULL |
|______________ _______________ _______________ _|_____________ __________|
Nov 13 '05 #122
Keith Thompson wrote:
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.


Sure, but they often go beyond that (IMO, obviously) and into the
territory of "Do It My (Our) Way Or Suffer My (Our) Wrath."
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.
There is a difference between "clever formatting" and people just
trying to communicate as best as they can with the tools they have.

The reality is, outside something that *requires* monospace font
for alignment purposes (such as our source code), formatted text
is *easier* to read. MUCH easier. And HTML is quickly becoming
a de facto standard for representing formatted text. Like it or
not, HTML newsgroups are probably going to be standard before long.

Which I think will--once we get used to it--improve communication
considerably. In company, we have Lotus Notes mail which uses a
(rather sadly drain bamaged) Rich Text Format that allows formatted
mail. I can write much more communicative and illustrative emails
using basic formatting tools.

There is, after all, a very good reason why books and magazines do
not use 80-column, monospace (except for special effect).
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.
Which would be via formatted text.
Too many newsgroups have descended into useless chaos. We don't
want to let that happen to comp.lang.c.
I think y'all use that rationale overmuch. Tech groups that lack
the sharp focus on topicality still seem pretty useful to me. For
example, comp.lang.lisp has about the same traffic, but lacks the
style.cops and topic.cops. Far as I can tell, the groups are about
the same--very, VERY useful in their language domain.
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.


I'd agree. How about someone with genuine interest in C who just
happens to believe in HTML and top posting and--outside that--makes
very intelligent, readable posts?

--
|_ CJSonnack <Ch***@Sonnack. com> _____________| How's my programming? |
|_ http://www.Sonnack.com/ _______________ ____| Call: 1-800-DEV-NULL |
|______________ _______________ _______________ _|_____________ __________|
Nov 13 '05 #123
Dave Vandervies wrote:
[If you haven't read the post I just made a little bit upthread,
go read it now and come back to this one.]
Without a date or reference, I have no idea WHICH post you mean.
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?
I think there's plenty of wrong to spread around on both sides.
Plenty of right, too.

I'm glad I don't live in your world.


How do you know? Do you really know my world?

--
|_ CJSonnack <Ch***@Sonnack. com> _____________| How's my programming? |
|_ http://www.Sonnack.com/ _______________ ____| Call: 1-800-DEV-NULL |
|______________ _______________ _______________ _|_____________ __________|
Nov 13 '05 #124
Programmer Dude wrote:
There is a difference between "clever formatting" and people just
trying to communicate as best as they can with the tools they have.


Good point. I am going to start using Abiword to post my articles,
those that use a newsreader that doesn't know how to deal with the
formatting markup will just have to wade through it. I figure those
lame enough to use a text only newsreader in a text based protocol
deserve what they get.

--
Noah Roberts
- "If you are not outraged, you are not paying attention."

Nov 13 '05 #125
<?xml version="1.0"?>
<!DOCTYPE abiword PUBLIC "-//ABISOURCE//DTD AWML 1.0 Strict//EN"
"http://www.abisource.c om/awml.dtd">
<abiword xmlns="http://www.abisource.c om/awml.dtd"
xmlns:awml="htt p://www.abisource.c om/awml.dtd"
xmlns:xlink="ht tp://www.w3.org/1999/xlink"
xmlns:svg="http ://www.w3.org/2000/svg"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:math="htt p://www.w3.org/1998/Math/MathML"
xmlns:dc="http://purl.org/dc/elements/1.1/" version="1.0.1"
fileformat="1.0 " styles="unlocke d">
<!--
=============== =============== =============== =============== ========= -->
<!-- This file is an AbiWord document.
-->
<!-- AbiWord is a free, Open Source word processor.
-->
<!-- You may obtain more information about AbiWord at www.abisource.com
-->
<!-- You should not edit this file by hand.
-->
<!--
=============== =============== =============== =============== ========= -->

<styles>
<s type="P" name="Normal" basedon="" followedby="Cur rent Settings"
props="font-family:Times New Roman; margin-top:0pt; font-variant:normal;
margin-left:0pt; text-indent:0in; widows:2; font-style:normal;
font-weight:normal; text-decoration:none ; color:000000; line-height:1.0;
text-align:left; margin-bottom:0pt; text-position:normal ;
margin-right:0pt; bgcolor:transpa rent; font-size:12pt;
font-stretch:normal"/>
</styles>
<pagesize pagetype="Lette r" orientation="po rtrait" width="8.500000 "
height="11.0000 00" units="in" page-scale="1.000000 "/>
<section>
<p style="Normal"> <c props="lang:en-US">I am just posting this so you
can see how truly awful it would be.</c></p>
<p style="Normal"> <c props="lang:en-US"></c></p>
<p style="Normal"> <c props="lang:en-US">When you post HTML to newsgroups
this is often what it looks like on the other side.</c></p>
</section>
</abiword>
BTW, in case you can't find the actual text of the message (oh gee, why
not?) this is what it says:

I am just posting this so you can see how truly awful it would be.

When you post HTML to newsgroups this is often what it looks like on the
other side.

--
Noah Roberts
- "If you are not outraged, you are not paying attention."

Nov 13 '05 #126
Dave Vandervies wrote:
[....ssssssssssN IP!]
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."
Nice polite question.
After a few minutes of collective "Huh?"-type confusion, Rick [...]
realized that the question was referring to the discussion of [five
minutes ago], and [answered].
A nice polite answer. Had it stopped there, no shouting.
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....


A *great* deal would depend on Rick's presentation, since he was
now in the position of commenting on someone's public behavior.
And he would have the advantage of facial and tonal cues, but you
still have to tread carefully when attempting to exert your will
on someone else.

Try Ruth's shoes for a moment. Upon approaching a new group, she
is immediately told she's doing wrong. In front of an audience.
At the very *least* I would suggest not doing that in front of an
audience. Even Westerners have a sense of saving face.

MAYBE it would have served everyone's purpose better if Rick just
let Ruth have her answer and allowed her to--if she stayed around--
learn the group dynamics in her own time.

--
|_ CJSonnack <Ch***@Sonnack. com> _____________| How's my programming? |
|_ http://www.Sonnack.com/ _______________ ____| Call: 1-800-DEV-NULL |
|______________ _______________ _______________ _|_____________ __________|
Nov 13 '05 #127
Noah Roberts wrote:
<p style="Normal"> <c props="lang:en-US">I am just posting this so
you can see how truly awful it would be.</c></p>
<p style="Normal"> <c props="lang:en-US"></c></p>
<p style="Normal"> <c props="lang:en-US">When you post HTML to
newsgroups this is often what it looks like on the other
side.</c></p>
Fascinating. No problem reading, BTW. If I wanted to view it in
fully formatted, I could dump it into a wide variety of things that
can display HTML.

No problem.
When you post HTML to newsgroups this is often what it looks like
on the other side.


So get out of the dark ages and get something that can render HTML.
I suspect it's going to be like HD tv. Eventually, the choice will
not be yours.

<borg>You <strong>WILL</strong> be assimilated</borg>

--
|_ CJSonnack <Ch***@Sonnack. com> _____________| How's my programming? |
|_ http://www.Sonnack.com/ _______________ ____| Call: 1-800-DEV-NULL |
|______________ _______________ _______________ _|_____________ __________|
Nov 13 '05 #128
Programmer Dude wrote:
.... snip ...
The reality is, outside something that *requires* monospace font
for alignment purposes (such as our source code), formatted text
is *easier* to read. MUCH easier. And HTML is quickly becoming
a de facto standard for representing formatted text. Like it or
not, HTML newsgroups are probably going to be standard before long.


That would simply open the door to script kiddies and other evil
types, and spell the death of using newsgroups at all. With pure
text you KNOW you cannot be attacked.

--
Chuck F (cb********@yah oo.com) (cb********@wor ldnet.att.net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home .att.net> USE worldnet address!
Nov 13 '05 #129
Programmer Dude <Ch***@Sonnack. com> writes:
Keith Thompson wrote:
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.


Sure, but they often go beyond that (IMO, obviously) and into the
territory of "Do It My (Our) Way Or Suffer My (Our) Wrath."
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.


There is a difference between "clever formatting" and people just
trying to communicate as best as they can with the tools they have.

The reality is, outside something that *requires* monospace font
for alignment purposes (such as our source code), formatted text
is *easier* to read. MUCH easier. And HTML is quickly becoming
a de facto standard for representing formatted text. Like it or
not, HTML newsgroups are probably going to be standard before long.


HTML has not become a de facto standard on Usenet.

The newsreader I use does not render HTML. (Actually, there might be
a way to tell it to do so, but I haven't looked into it; in any case,
many other newsreaders in common use cannot render HTML at all.) I
run it under an 80-column terminal emulator with a fixed-width font.
I'm certain that many, perhaps most, of the regulars on this newsgroup
are in the same position.

I suppose there's a standard for HTML Usenet postings (there seems to
be one for e-mail, and the message formats are very close), but I
rarely see any. If I did, I probably wouldn't bother to decode them.

[...]
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.


Which would be via formatted text.


Not for most Usenet readers, and certainly not for most readers of
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.


I'd agree. How about someone with genuine interest in C who just
happens to believe in HTML and top posting and--outside that--makes
very intelligent, readable posts?


I don't believe I've seen any examples of that.

--
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 #130

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.