473,805 Members | 1,963 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 8768
Richard Heathfield wrote:
The newsreader I use does not render HTML.
There are plenty that do. Some are even free.


But the one he has chosen to use does not. That's /his/ choice.


Of course. But if the world moves on to bigger and better things,
then that choice may leave one behind.

The thing... The thing is, don't expect the rest of us to hang back
with you just because you *choose* to stay behind. We may choose
to move forward.
I run it under an 80-column terminal emulator with a fixed-width
font.


How quaint. Thinking of joining the new millenium anytime soon?


Thinking of conceding other people's right to use the software
/they/ want to use anytime soon?


You know me well enough to know I'm *absolutely* in favor of choice.
If you want to live off the land in animal skins and cook on an
open fire, hey, more power to ya. Just don't expect that that
*defines* reality in any way.
Of using inefficient, ancient tools? That's too bad!!


I find nothing terribly inefficient about a fixed-pitch display.


Ever wonder why books and magazines don't use monospace fonts for
normal text? Because it's harder to read. Well-established fact.
In fact, I find it very easy to read, especially for source code.
Regardless of what you find, the fact is that monospace fonts are
best for things--as I have said, such as source--which NEED to be
correctly spaced.

Note, too, the issue isn't "easy to read", it's "EASIER to read".
On this newsgroup, we see a /lot/ of source code, [...] I'd hate
to think what it would look like in a proportional font.
No problem. HTML easily supports a change to monospace. It's even
implicit in the <pre> (and others) tag.
As for ancientiosity, I see no reason why a tool should be
abandoned just because it's getting on a bit.
If "just because it's getting on a bit" were the issue, I'd agree.
Since it isn't, I don't.
Do you still use wheels?
Not when better alternatives are available (don't YOU have an
antigrav sled? :-). If I COULD fly rather than wheel, believe
me, I would!
Fire?
Only as campfires or to light cigars. I use microwaves to do a lot
of my "cooking". Modern, clean electricity does the rest.
Or are they too old-fashioned now?
Old fashioned *and* unwieldy. Just like 80-column text. Fine when
it was the only (or best) game on the block. But That Day Is Over.
Your desire to remain in the era of buggy whips not withstanding,


Where did Keith Thompson mention such a desire?


[sigh] This is you being deliberately obtuse again, and I'm SO not
interesting in sinking down to that level. I presume any intelligent
adult--including you--knows **exactly** what I meant.

If you want to debate this on *ideas* and *issues* I'm delighted.
If you want to play stupid, childish word games, I'm not playing.
the *fact* of the matter is that formatted text is *easier* to
read. This--hopefully--is not in dispute.


It is. See above.


You are, to be blunt, wrong. The evidence is visible in EVERY SINGLE
BOOK on your bookshelves. Ask **ANY** publisher of printed material
(because I know you won't take my word for it).
What is, perhaps, in dispute is the value of hanging on to ancient
systems whose day is long, long past.


Who is to judge whether a system's day is long, long past? You? Bill
Gates?


Me. My opinion, my decision. Your opinions will reflect yours.

But let's consider the question: Has plain text's day passed?

Outside of source code, I'd say yes it has (or *should* in places
where it yet lingers). Why resort to *emphasis* when I could just
use <b>. Or <strong>. Or <u>. Or <i>. Or a font change. Or a
color change. Or any combination.

HTML offers a wonderful, potentially universal, way to add dimension
to text. The EXACT SAME dimension that we've enjoyed for decades in
our books, magazines and newspapers. Why NOT enjoy the power of the
additional information-carrying capacity of formatted text?
Each of us is perfectly capable of deciding which software he or
she wants to use.


Gee, ya think?

--
|_ CJSonnack <Ch***@Sonnack. com> _____________| How's my programming? |
|_ http://www.Sonnack.com/ _______________ ____| Call: 1-800-DEV-NULL |
|______________ _______________ _______________ _|_____________ __________|
Nov 13 '05 #141
Keith Thompson wrote:
The newsreader I use does not render HTML.
There are plenty that do. Some are even free.


That's nice. I don't *want* my newsreader to render HTML.


Okay. Your choice.
...the *fact* of the matter is that formatted text is *easier* to
read. This--hopefully--is not in dispute.


I have no problem reading fixed-width text.


Once again, PLEASE READ THE WORDS. (In fact, one has to wonder if
formatted text wouldn't have helped make the point! :-)

Formatted, proportionally-spaced fonts are *E*A*S*I*E*R to read.
Repeat: eas***>>>IER<<< ***

Not "easy". EASIER.
For much of what I read, including C source code, formatted text
would be more difficult to read.
What, besides source code, would be easier to read in monospace?
Can you name any real book set in monospace? Do you wonder why not?
How about K&R? If monospace is so great, why didn't they use it in
their book? After all, it's *about* C source. If ANY book deserved
to be set in mono, seems K&R would be a good choice.

Yet, it wasn't.
A variable-width font might be easier to read for running
English text like this,...
There really is no "might be" about it.
...but the drawbacks would greatly outweigh the benefits.
What drawbacks? Seriously. Given the ability to drop into mono
anytime you want/need to, what drawbacks are there that would
outweigh the obvious benefits (benefits enjoyed by just about
every single technical manual, book or magazine you've ever read).
What is, perhaps, in dispute is the value of hanging on to
ancient systems whose day is long, long past.


So if we all do things the way you want us to, we'll all be just
fine, right?


Well, that's probably true, but it's not my point here. MY POINT
is getting you (or trying to, anyway) to examine exactly why you
are clinging to an ancient standard rather than embracing a new
and potentially useful one.

<troll> Of course, perhaps that's the wrong question to ask people
in a C group.... </troll>
The tools you advocate are newer, flashier, and more complex. That
doesn't make them better for this specific purpose.
Newer, certainly. Flashier? Depends on your definition. Do you
consider newspapers, magazines and books to be "flashy"? Would you
prefer *all* printed material be 80-col mono?

As for complex.... hmmm. Setting up Reflections telnet right was
much more involved than merely installing and using my newsreader.
Nice sig block, but it doesn't look very good in a variable-width
font, does it?


Obviously, in a proportionally-spaced environment, I would use a
different sig.

--
|_ CJSonnack <Ch***@Sonnack. com> _____________| How's my programming? |
|_ http://www.Sonnack.com/ _______________ ____| Call: 1-800-DEV-NULL |
|______________ _______________ _______________ _|_____________ __________|
Nov 13 '05 #142
Programmer Dude <Ch***@Sonnack. com> writes:
Keith Thompson wrote: [...]
...the *fact* of the matter is that formatted text is *easier* to
read. This--hopefully--is not in dispute.


I have no problem reading fixed-width text.


Once again, PLEASE READ THE WORDS. (In fact, one has to wonder if
formatted text wouldn't have helped make the point! :-)

Formatted, proportionally-spaced fonts are *E*A*S*I*E*R to read.
Repeat: eas***>>>IER<<< ***

Not "easy". EASIER.


Yes, yes, I understand.

I read the words. My response was not intended to directly refute
what you wrote; I was commenting further on it. To be clear, I don't
disagree with your assertion that variable-width text text (as we see
in books, magazines, most web sites, etc.) is typically easier to read
than fixed-width text. What I dispute is the relevance of that fact
to Usenet.
For much of what I read, including C source code, formatted text
would be more difficult to read.


What, besides source code, would be easier to read in monospace?
Can you name any real book set in monospace? Do you wonder why not?
How about K&R? If monospace is so great, why didn't they use it in
their book? After all, it's *about* C source. If ANY book deserved
to be set in mono, seems K&R would be a good choice.

Yet, it wasn't.


Agreed. When they published K&R, it was well worth it to go to the
effort of formatting it in a variable-width font, as is done for most
books. It might have been easier and cheaper to use a plain
typewriter font; I'm glad they went to the extra effort to make it
more readable.

When I post to Usenet, it's not worth my time to do that kind of
formatting. If HTML postings were generally supported, I suppose I
could go to the effort of specifying that I want this paragraph to be
in a variable-width font, and use <pre>...</pre> for code samples, and
actual *boldface* and _underlining_ where it's appropriate, and so on.
Quite frankly, it's not worth the effort. The content of what I write
is what's important (or unimportant, as the case may be). If you want
to use a newsreader that lets you read it in your favorite font, feel
free; I'm not interested in adding extraneous formatting information.
A variable-width font might be easier to read for running
English text like this,...


There really is no "might be" about it.


Ok, whatever.
...but the drawbacks would greatly outweigh the benefits.


What drawbacks? Seriously. Given the ability to drop into mono
anytime you want/need to, what drawbacks are there that would
outweigh the obvious benefits (benefits enjoyed by just about
every single technical manual, book or magazine you've ever read).


Just about every single technical manual, book, or magazine I've ever
read was produced by professionals. Just about every Usenet posting
I've ever read was not. Look at how much trouble we have with posters
not following the simple plain text standards we have now. I don't
want to give the trolls the ability to shout at me in 36-point
blinking magenta wingdings.

Usenet works just fine as it is.

If it does change from a plain-text forum to one where fancy
formatting is allowed or encouraged, I suppose I'll deal with it, but
I see no sign of that actually happening. (I'm not sure that Usenet
would survive the transition, though of course it's survived a lot of
things before.)

[...] Well, that's probably true, but it's not my point here. MY POINT
is getting you (or trying to, anyway) to examine exactly why you
are clinging to an ancient standard rather than embracing a new
and potentially useful one.


Two reasons: the ancient standard works, and the alleged new standard
doesn't seem to exist.

--
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 #143
On Fri, 07 Nov 2003 15:32:45 -0600, Programmer Dude wrote:
HTML offers a wonderful, potentially universal, way to add dimension
to text. The EXACT SAME dimension that we've enjoyed for decades in
our books, magazines and newspapers. Why NOT enjoy the power of the
additional information-carrying capacity of formatted text?


One good reason not to use HTML is that HTML sucks rocks if your
goal is to format text. It is not a text-formatting language and
never was intended to be. It does have some deprecated text-
formatting capabilities, but that's not a reason to use it as
the usenet text formatting language.

As for another comment you made, the newsreader I use defaults to
displaying articles in a proportional font. I tried it out for a
week, and then set the font used for article bodies to courier.
I like it better this way.

-Sheldon

Nov 13 '05 #144
>Programmer Dude <Ch***@Sonnack. com> writes:
Formatted, proportionally-spaced fonts are *E*A*S*I*E*R to read.
Repeat: eas***>>>IER<<< ***

Not "easy". EASIER.

In article <ks************ @nuthaus.mib.or g>,
Keith Thompson <ks*@cts.com> wrote:Yes, yes, I understand.
As do I. But I contend that this claim is actually *wrong*!

More precisely, it is insufficient.

Proportional fonts printed at high resolutions (several thousand
dpi) have been found to be easier to read when printed on paper.

Proportional fonts (mis)displayed on low-resolution, typically 75
and up to perhaps 100 dpi, computer screens have not been shown to
be easier to read. As I understand it, studies conflict, but still
lean towards "fixed-width fonts are easier to read".
I read the words. My response was not intended to directly refute
what you wrote; I was commenting further on it. To be clear, I don't
disagree with your assertion that variable-width text text (as we see
in books, magazines, most web sites, etc.) is typically easier to read
than fixed-width text. What I dispute is the relevance of that fact
to Usenet.
Even on web sites, I find the variable-width fonts rather klunky.
Some of the better rendering engines, combined with antialiased
fonts of sufficient sizes, do a better job, making it about as
readable as fixed-width text. But there remain a number of stumbling
blocks, including people whose web pages are designed for very low
resolution (e.g., 640 x 480) displays -- I use 1600x1200 on this
screen, and 1920x1200 on my Mac, and have found Mozilla's "ignore
the web page's tiny-size-font requests" feature invaluable. Text
meant to be shown at (say) 9 points, but actually rendered at the
equivalent of approximately 5 points, is quite eye-straining.

When (and I use the word "when" because I believe "if" is incorrect)
we have 300+ dpi computer displays -- preferably wall-size, say
around 40,000 by 30,000 or so pixels -- *then* it may be time to
move to proportional fonts. :-) (Maybe the wall-size screen ratio
should be 16:9 rather than 4:3.)
Just about every single technical manual, book, or magazine I've ever
read was produced by professionals.
(Well, there was "Wired" magazine. :-) )
Just about every Usenet posting I've ever read was not.


Indeed. I suspect far too many would look like, well, "Wired"
magazine...
--
In-Real-Life: Chris Torek, Wind River Systems
Salt Lake City, UT, USA (40°39.22'N, 111°50.29'W) +1 801 277 2603
email: forget about it http://67.40.109.61/torek/index.html (for the moment)
Reading email is like searching for food in the garbage, thanks to spammers.
Nov 13 '05 #145

On Fri, 7 Nov 2003, Keith Thompson wrote:

Programmer Dude <Ch***@Sonnack. com> writes:
What, besides source code, would be easier to read in monospace?
Can you name any real book set in monospace? Do you wonder why not?
I have seen books in Borders stores set in monospace. The ones
I'm thinking of are not "art" books, either. They're mathematical
monographs bound in flimsy paper covers, often with the symbols
drawn in by hand and then Xeroxed. See below for why this is a
good thing.
How about K&R? If monospace is so great, why didn't they use it in
their book? After all, it's *about* C source. If ANY book deserved
to be set in mono, seems K&R would be a good choice.

Yet, it wasn't.
Agreed. When they published K&R, it was well worth it to go to the
effort of formatting it in a variable-width font, as is done for most
books. It might have been easier and cheaper to use a plain
typewriter font; I'm glad they went to the extra effort to make it
more readable.


Keith is right: plain ASCII text is one of the easiest media to
format readably. It's not that plain text is easier to read than
proportionally formatted text; it's that one can more easily (to
use a resident Brit's phrase) make a pig's breakfast of proportionally
formatted stuff.
For paper stuff, typewriting or even text editing is often cheaper
than word processing, too, as Keith points out. That's one reason
why those monographs were fixed-pitch -- cost. (Another reason, I
suppose, would be the substance-over-aesthetics attitude Keith
described.)
When I post to Usenet, it's not worth my time to do that kind of
formatting. If HTML postings were generally supported, I suppose I
could go to the effort of specifying that I want this paragraph to be
in a variable-width font, and use <pre>...</pre> for code samples, and
actual *boldface* and _underlining_ where it's appropriate, and so on.
Quite frankly, it's not worth the effort.
I completely agree. Your newsreader, that lets you read HTML
mail -- does it let you compose HTML mail, too? Easily? Without
a lot of fussy clicking of buttons and so on? -- You know, it
probably does. But is it really *easier* to hit Ctrl-B instead
of Shift-8 when I mean *bold*, or Ctrl-U instead of Shift[-]?
I don't think it is. And if the editor were to really give you
control of the process, the composition of HTML messages could
easily take much longer than the composition of messages free
from <meta> tags, hyperlinks, and what-have-you.
The content of what I write
is what's important (or unimportant, as the case may be). If you want
to use a newsreader that lets you read it in your favorite font, feel
free; I'm not interested in adding extraneous formatting information.


In fact, I'm willing to bet that *some* news archive out there
on the Web will do that sort of trivial formatting for you.
ISTR that Google automatically hyperlinkifies URLs in Usenet
posts, although it doesn't go so far as to edit in *bold* <b>
tags or /italic/ <i> tags. (That's a good, tractable AI problem
right there.)

<snip>
What drawbacks? Seriously. Given the ability to drop into mono
anytime you want/need to, what drawbacks are there that would
outweigh the obvious benefits (benefits enjoyed by just about
every single technical manual, book or magazine you've ever read).


Just about every single technical manual, book, or magazine I've ever
read was produced by professionals. Just about every Usenet posting
I've ever read was not. Look at how much trouble we have with posters
not following the simple plain text standards we have now. I don't
want to give the trolls the ability to shout at me in 36-point
blinking magenta wingdings.


***HEAR HEAR!***

(See, couldn't that have been a hell of a lot more annoying
in HTML?)
Nor do I really want to give spammers the ability to count hits
on Usenet postings, like HTML mail has given them the ability to
count hits on private email.

I suspect that HTML will never make it into Usenet. Those
interested in making their correspondences look pretty are
usually simply not interested in public discourse.
my $.02,
-Arthur
Nov 13 '05 #146
Programmer Dude wrote:
.... snip about html in newsgroups ...
Your desire to remain in the era of buggy whips not withstanding,
the *fact* of the matter is that formatted text is *easier* to
read. This--hopefully--is not in dispute.


Yes it is. How many illegible html pages have you seen because
some imbecile carefully selected colors and whatnot that have no
contrast to you. After 50 odd years those jokers demonstrated to
me that I am partially color-blind. Also fancy background
patterns that take all year to render. Also little bitty fonts
that require a Hubble scope to see. Some of them even pack the
html up as 6 bit encoded, making things unsearchable and hard to
filter.

So the best (newsgroup) technique is "see html, kill html".

To make things readable simply use proper paragraphing, spelling,
punctuation, limit line length to about 65 chars, and use text.

--
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 #147
Programmer Dude wrote:
Richard Heathfield wrote:

Your desire to remain in the era of buggy whips not withstanding,


Where did Keith Thompson mention such a desire?


[sigh] This is you being deliberately obtuse again, and I'm SO not
interesting in sinking down to that level.


No, it's you making an ad hominem attack on a valuable contributor to this
newsgroup, and then not backing it up when called on it. Too late, Chris.
You *already* sank to that level, and I don't plan on following you down.

Will you apologise publicly to Keith Thompson for the slur?

--
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 #148
On Fri, 7 Nov 2003 21:42:46 -0500 (EST)
"Arthur J. O'Dwyer" <aj*@nospam.and rew.cmu.edu> wrote:
On Fri, 7 Nov 2003, Keith Thompson wrote:
<snip>
The content of what I write
is what's important (or unimportant, as the case may be). If you
want to use a newsreader that lets you read it in your favorite
font, feel free; I'm not interested in adding extraneous formatting
information.


In fact, I'm willing to bet that *some* news archive out there
on the Web will do that sort of trivial formatting for you.
ISTR that Google automatically hyperlinkifies URLs in Usenet
posts, although it doesn't go so far as to edit in *bold* <b>
tags or /italic/ <i> tags. (That's a good, tractable AI problem
right there.)


I've used at least one news reader which *did* apply *bold*, /italic/,
_underline_ and possibly other mark ups and did a good job of it. So
people who want such things have the option of choosing a news reader
that supports them *without* causing problems people who do not want
them.
<snip>
What drawbacks? Seriously. Given the ability to drop into mono
anytime you want/need to, what drawbacks are there that would
outweigh the obvious benefits (benefits enjoyed by just about
every single technical manual, book or magazine you've ever read).
Just about every single technical manual, book, or magazine I've
ever read was produced by professionals. Just about every Usenet
posting I've ever read was not. Look at how much trouble we have
with posters not following the simple plain text standards we have
now. I don't want to give the trolls the ability to shout at me in
36-point blinking magenta wingdings.


***HEAR HEAR!***

(See, couldn't that have been a hell of a lot more annoying
in HTML?)
Nor do I really want to give spammers the ability to count hits
on Usenet postings, like HTML mail has given them the ability to
count hits on private email.


Of course, a sufficiently dumb rendering engine (i.e. one that does not
follow links) solves that problem.
I suspect that HTML will never make it into Usenet. Those
interested in making their correspondences look pretty are
usually simply not interested in public discourse.


It can also make things look a lot messier what person A formats one way
then person B replies but formats the stuff s/he writes differently then
person C chooses yet another style...

I've seen it on web forums where simple markups are possible and IMHO it
makes it harder to read. One of many reasons I stick with Usenet rather
than web forums.
--
Mark Gordon
Paid to be a Geek & a Senior Software Developer
Although my email address says spamtrap, it is real and I read it.
Nov 13 '05 #149
CBFalconer <cb********@yah oo.com> writes:
Programmer Dude wrote:

... snip about html in newsgroups ...

Your desire to remain in the era of buggy whips not withstanding,
the *fact* of the matter is that formatted text is *easier* to
read. This--hopefully--is not in dispute.


Yes it is. How many illegible html pages have you seen because
some imbecile carefully selected colors and whatnot that have no
contrast to you. [...]


To follow up on that, I use a text-based news/mailreader that has
hooks into a text-based HTML renderer that supports color. You'd
be surprised (or maybe not) just how often HTML articles are
completely unreadable because they render as white-on-white.
--
"Given that computing power increases exponentially with time,
algorithms with exponential or better O-notations
are actually linear with a large constant."
--Mike Lee
Nov 13 '05 #150

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.