473,854 Members | 1,967 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 8877
Programmer Dude wrote:

Sheldon Simms wrote:
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 depends on your definition of text-formatting. If you define it
as "page layout" I agree it was never intended as such. If you
define it as "text attributes" then it clearly WAS originally
intended as such (hence those depreciated tags).

I see two big advantages to HTML over plain text: The ability to
provide more natural emphasis (that is, true italics and bold
rather than the crude ASCII versions of such). And the big one:
the ability to wrap to fit the user's window width (and I mean
"window", not "Window").

Formatting with hard returns to 78, 77, 75, 72m 68 or 65 is a start,
but wouldn't it be nice to be able to tuck a small window somewhere
on your screen (say at 40 cols) and STILL have the text read nice?

So far, I see advantages and no disadvantages.. ..


The maxim for Internet transmission used to be "be liberal in what
you accept, conservative in what you send".

The existing system known as Usenet ranges to serve people from those
using HTML emabled readers to those using Tin. The Tin folks
will not understand HTML very easily.

Pure, text editor ASCII text is a least common denominator, a
simplifier discipline on the medium which costs nothing and
*really* restricts nobody. If you want HTML, put it on a
webpage and refer to it in Usenet posts.

Especially since HTML itself is now an evolving standard,
it should be clear that pure ASCII text has advantages over
any sort of interpreted formatting.

Besides, it's more or less implied by the early Usenet RFCs. In
c.l.c terms, text other than ASCII text will induce undefined
behavior. If you wanna chat, chat by all means, but let's at least
make an attempt to maintain *some* measure of distinction between
that and Usenet.
--
|_ CJSonnack <Ch***@Sonnack. com> _____________| How's my programming? |
|_ http://www.Sonnack.com/ _______________ ____| Call: 1-800-DEV-NULL |
|______________ _______________ _______________ _|_____________ __________|

--
Les Cargill
Nov 13 '05 #161
Chris Torek wrote:
Proportional fonts printed at high resolutions (several thousand
dpi) have been found to be easier to read when printed on paper.
(And, obviously, when printed in non-digital mediums such as
printing presses.)
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".
Interesting. I wasn't aware of that. I was aware there it had
been shown that sans-serif fonts (usually considered fatiguing
for lengthy text) are better on PC screens, because the serifs
turn out to be visual clutter at low rez (which suggests the odd
idea that a sans-serif, monospace font would be ideal...I just
don't think I *know* of one!)
Even on web sites, I find the variable-width fonts rather klunky.


I just copy/pasted this message into Word and looked at it with
Times New Roman, Arial, Courier New and (my personal source code
choice) Lucida Console. All 10 point.

The Times Roman looked the best to me, the Courier the worst.

Personal perception, obviously, but I question the idea that
monospace is easier. As you say, the test results vary.

Maybe I'll try reading amUSENET in some variable pitch font for
a while and see what I think....
Just about every Usenet posting I've ever read was not.


Indeed. I suspect far too many would look like, well, "Wired"
magazine...


Perhaps that will serve the same filtering purpose as top posting
and over-quoting do now.

--
|_ CJSonnack <Ch***@Sonnack. com> _____________| How's my programming? |
|_ http://www.Sonnack.com/ _______________ ____| Call: 1-800-DEV-NULL |
|______________ _______________ _______________ _|_____________ __________|
Nov 13 '05 #162
Richard Heathfield wrote:
...then not backing it up when called on it.


You and your "calling me on it."

You know what, Richard: put me in your killfile and *leave* me there
this time. I think we'll both be happier.

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


Okay, cool.
What I dispute is the relevance of that fact to Usenet.
And you may have a good point.
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.


I worked in the graphic arts area and my dad is into book publishing
(we published a few "vanity books" when he had he graphic arts biz).

There is no extra effort. For *many* years now, typesetting has been
computer controlled (for a long time with dedicated machines, but
increasingly with PC software). The kerning and justification needs
are all handled by computer. The "inputter" just types. (Although
I suspect these days, most authors present the data electronically,
so no additional typing--just dump into a layout program.)
When I post to Usenet, it's not worth my time to do that kind of
formatting.
If you want to present just text (no emphasis), you'd just type.
But advanced features would be there if desired.
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,...
The existing tools are already more sophisticated than that. The
emphasis bits... just highlight and Ctrl-B (bold) or Ctrl-U
(underline) or Ctrl-I (italic). Way I'd probably design a system,
you'd specify the default font. If you included source code, you
would highlight and press ... well, whatever key you like.

At no time should anyone have to input the actual tags (unless
they WANTED to for advanced features or fine control).
Quite frankly, it's not worth the effort.
As you state it, I agree completely. But if it were no different
than you do today?
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.
Agreed on all counts. If you don't want to be *bold* or /italic/
or _underlined_, don't be! Myself, I LIKE the power of expressive
text.
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.
Yes, I have to confess, that is a very good point.

[shrug] Perhaps it's just part of a growth process. I am pretty
sure it's inevitable.
Usenet works just fine as it is.


[grin] For *some* definition of "works".
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.


Yet, as you say above, we still have problems with people who don't
edit or who commit the Top Post Sin or whatever. I'm not sure that
mis-use of something by the ignorant indicates avoidance (should we
ban C because people write bad C?).

MAYBE, if I'm right that it's inevitable, it's smart to get in on
the ground floor in *creating* the standard.

--
|_ CJSonnack <Ch***@Sonnack. com> _____________| How's my programming? |
|_ http://www.Sonnack.com/ _______________ ____| Call: 1-800-DEV-NULL |
|______________ _______________ _______________ _|_____________ __________|
Nov 13 '05 #164
Arthur J. O'Dwyer <aj*@nospam.and rew.cmu.edu> wrote:
Unless you're proposing an *amazing* leap forward in natural-language
parsing within the above "numbered" years,
huh?
the responsibility for courteous HTML use remains on the user's
shoulders, not on his software.
Appears to be FUD.

A good client program would hide the HTML from the user, allowing the
user to only worry about how it looks and then transmit standard
compliant HTML.
Plain text does a great job of transmitting information from place
to place and person to person.
I agree. So, what do you think HTML is?
Re an earlier argument possibly by
someone else: No, I have no books on my shelf written in monospace,
but nor do I own any books with colored text, bold text interspersed
with regular, "smilies," or -- god forbid -- blinking text.
A client program could easily take such things out, if you didn't not
want to see them. The client program is what blinks the text, shows the
smily, etc. and could simply provide a preference to not show such
things to those who didn't want to see them.

This just seem like more FUD.
Like someone else also said: Text formatting is fine, but HTML sucks at
text formatting. :-)


CSS is excellent at text formatting and, these days, it quite
intertwined with HTML such that one can almost assume the inclusion of
CSS with the mere mention of HTML...and, in this discussion, with me,
one should.
Nov 13 '05 #165
"Arthur J. O'Dwyer" wrote:
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.
Well, two points. My personal experience is that plain ASCII text
is harder to format the way I want it (which I'd like to think is
easily readable). I spend more time than I'd like dealing with
line endings and ASCII emphasis.

I compare my amUSENET writings to the writing I do incompany for
tech docs or (RTF-based) email, and I get WAY more bang for my
buck with more powerful text features.

Indented paragraphs alone are worth their weight in gold, not to
mention auto-wrapping paragraphs and automatic justification.
Having the ability to do bullet lists would be nice, too!

Second point is that I'm not sure I want to live in a world
governed by the lowest common denominator. In fact, I KNOW I
don't.
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.
Come again? It costs no more to use a variable-pitch font than it
does to use a fixed-pitch one. These days (and for quite some time
now), it's just typing. The software does the rest.
(Another reason, I suppose, would be the substance-over-aesthetics
attitude Keith described.)
I favor substance+aesth etics. Must be my art background talking.
I completely agree. Your newsreader, that lets you read HTML
mail -- does it let you compose HTML mail, too? Easily?
Trivially so. In fact, I had to turn it off.
But is it really *easier* to hit Ctrl-B instead of Shift-8 when
I mean *bold*, or Ctrl-U instead of Shift[-]?
Definitely (IMO, obviously). Control+alpha is much easier to me
than Shift+symbol. More importantly, it looks a million times
better. Maybe even a billion times! (-:
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.
Formatting a message carefully takes some time, period. If I just
want to type without any special formatting, then it hardly matters
what the editor outputs. But if I have something I can make more
clear using formatted text, that sounds like a win.
***HEAR HEAR!***

(See, couldn't that have been a hell of a lot more annoying
in HTML?)
Not really (to me). (I'm not easily annoyed by text.)
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.
?? How do they do that? (Are you talking using images?)
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.


[shrug] Time will tell!

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


And you claim they would have been readable if only they'd used
a monospace font?
Also fancy background patterns that take all year to render.
Monospace fixes this, too?
Also little bitty fonts that require a Hubble scope to see.
What about little bitty monospace fonts?
Some of them even pack the html up as 6 bit encoded, making
things unsearchable and hard to filter.
You mean that Base64 stuff? Monospace can't fix that, either.
To make things readable simply use proper paragraphing, spelling,
punctuation, limit line length to about 65 chars, and use text.


Which is decimated in a 60-column window. HTML would wrap nicely.

--
|_ CJSonnack <Ch***@Sonnack. com> _____________| How's my programming? |
|_ http://www.Sonnack.com/ _______________ ____| Call: 1-800-DEV-NULL |
|______________ _______________ _______________ _|_____________ __________|
Nov 13 '05 #167
Programmer Dude <Ch***@Sonnack. com> writes:
"Arthur J. O'Dwyer" wrote:

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


?? How do they do that? (Are you talking using images?)


Yes, they're called "web bugs". An e-mail message contains an IMG tag
with a URL specifying the location of the image. When you view the
message, your client downloads the image file so it can show it to
you. Voila, the server hosting the image sees an http connection from
your IP address, confirming that you've read the message. The images
are typically a single pixel matching the background color. They can
even customize the URL for each message so they can tell which copy of
the message was viewed.

<http://www.eff.org/Privacy/Marketing/web_bug.html>

--
Keith Thompson (The_Other_Keit h) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://www.sdsc.edu/~kst>
Schroedinger does Shakespeare: "To be *and* not to be"
(Note new e-mail address)
Nov 13 '05 #168
Programmer Dude <Ch***@Sonnack. com> writes:
I compare my amUSENET writings to the writing I do incompany for
tech docs or (RTF-based) email, and I get WAY more bang for my
buck with more powerful text features.

Indented paragraphs alone are worth their weight in gold, not to
mention auto-wrapping paragraphs and automatic justification.
Having the ability to do bullet lists would be nice, too!


All of these are possible in plain text. My newsreader makes
them easy, too.
--
"The lusers I know are so clueless, that if they were dipped in clue
musk and dropped in the middle of pack of horny clues, on clue prom
night during clue happy hour, they still couldn't get a clue."
--Michael Girdwood, in the monastery
Nov 13 '05 #169
Programmer Dude wrote:
CBFalconer wrote:
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.


And you claim they would have been readable if only they'd used
a monospace font?
Also fancy background patterns that take all year to render.


Monospace fixes this, too?
Also little bitty fonts that require a Hubble scope to see.


What about little bitty monospace fonts?
Some of them even pack the html up as 6 bit encoded, making
things unsearchable and hard to filter.


You mean that Base64 stuff? Monospace can't fix that, either.
To make things readable simply use proper paragraphing, spelling,
punctuation, limit line length to about 65 chars, and use text.


Which is decimated in a 60-column window. HTML would wrap nicely.


Fonts, colors, sizes etc. are none of the senders business. By
using plain text and limiting lines to 65 chars I can display it
in sizes, colors, fonts, etc. that SUIT ME when reading (which I
won't if it is in html).

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

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.