473,839 Members | 1,480 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
Programmer Dude wrote:
Richard Bos wrote:

(which suggests the odd idea that a sans-serif, monospace font
would be ideal...I just don't think I *know* of one!)


You've never used a _real_ terminal? *Blink* Even most MS-DOS
computers originally had sans-serif monospaced fonts.

Yes. But the name of that font?.....

It was probably a basic 5x7 ROM encoded display font, ya know?


OK, hardware time.

You want something that's informally called the "IBM ASCII Character set"
(sic) that's documented in the IBM PC/XT Technical Reference

Sorry, I don't have an IC number for you; my guess is that it was a custom
ROM defined by (if not built by) IBM. While my resources give the pinouts
for the video controller (a 6845, they say), no mention of the chip id of
the rom is given.

Sorry
--
Lew Pitcher

Master Codewright and JOAT-in-training
Registered Linux User #112576 (http://counter.li.org/)
Slackware - Because I know what I'm doing.

Nov 13 '05 #211
Richard Heathfield wrote:
[...] I read my email in vi (well, all right, vim). [...]


Do you do it ~comfortably~? I've always wanted to do this but have never
found a non-clumbsy way to do it. May I email you regarding your setup? (In
plain-text, of course.)

Regards,
Bob
Nov 13 '05 #212
Richard Heathfield <do******@addre ss.co.uk.invali d> wrote:
Personally, I'm getting more and more fed up of off-topic bickering such
as has been seen in this thread, and it's getting to the point where I
would go for the second option rather than the first, because the first
only leads to asinine threads like this one.


I am amazed that it has taken you this long to figure that out.
The boy is becoming a man.

--
Nov 13 '05 #213
Alan Balmer wrote:
My opinion is that true bold/italic/underline is more transparent
than their ASCII alikes
I think I have to agree with that, so long as it's transparent to
a reader which doesn't support it.


That's the rub, isn't it. A plain text reader probably won't have
a "remove HTML tags" option (which would be simple to implement).

Not intending to open another can of worms, but MIME multi-part
would (almost) solve the problem. One part plain text, one part
HTML. Everyone wins.

Except for those readers that don't do MIME, either. :-\

I do fully understand and appreciate the plain text thing (and
obviously have been participating in it for a couple decades).

I just also think the time may be at hand when the lowest common
denominator could be moved up a notch. Maybe not quite "today"
or "tomorrow", but perhaps "next week" or "next month"...
Just don't send me HTML!


I won't. For now. (-:

--
|_ CJSonnack <Ch***@Sonnack. com> _____________| How's my programming? |
|_ http://www.Sonnack.com/ _______________ ____| Call: 1-800-DEV-NULL |
|______________ _______________ _______________ _|_____________ __________|
Nov 13 '05 #214
Richard Heathfield wrote:
In this case, what you call "advanced" is what most people
taking part in this discussion would consider retarded or
regressed,...
No, those words would not be appropriate. "Undesirabl e" (for
arguably good reasons) or "unwelcome" or "dangerous" or "unwieldy"
or "problemati c" would all be appropriate words.
...because providing newbies with the power to post HTML into
comp.lang.c without also providing them with the wisdom not to
is not a sign of advancement, but of poverty of thought.


No, that's just your *opinion* based on your desire for a TTY text
environment. The concept of "advanced" or "retarded" doesn't apply.
Isn't the point of TTY text a lowest common denominator environment?
Isn't the point avoiding advanced features not supported by all?

Look, formatted text IS a true superset of unformatted text. A
thing with more features and capabilities than something else is
advanced, pure and simple.

Your desires, evaluations and opinions are an unrelated matter.

So - which is better? To say to these people "please don't post in
HTML" and then help them out with their C question, or to ignore
their articles completely without even telling them why they're
being ignored?


I don't agree those are the only choices.


But you don't get to choose other people's actions for them,..


??? The reply doesn't seem to connect to the quoted bit at all.

--
|_ CJSonnack <Ch***@Sonnack. com> _____________| How's my programming? |
|_ http://www.Sonnack.com/ _______________ ____| Call: 1-800-DEV-NULL |
|______________ _______________ _______________ _|_____________ __________|
Nov 13 '05 #215
Bob Chan <nospam> wrote:
Richard Heathfield wrote:
[...] I read my email in vi (well, all right, vim). [...]
Do you do it ~comfortably~?


Yes. I have an excellent office-type chair, with a nice leather cover and
proper armrests.
I've always wanted to do this but have never
found a non-clumbsy way to do it.
vi em*

That's pretty elegant.
May I email you regarding your setup?
(In plain-text, of course.)


Well, you could, but I get about a thousand emails a day, so yours might get
lost in the noise. (No, I'm not joking or exaggerating. I wish I were.)

I'm currently in the process of solving my kiloemail problem. Normal service
will be resumed in several months. I hope.

--
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 #216
Programmer Dude wrote:
Richard Heathfield wrote:
In this case, what you call "advanced" is what most people
taking part in this discussion would consider retarded or
regressed,...
No, those words would not be appropriate.


Clearly, we disagree.
"Undesirabl e" (for
arguably good reasons) or "unwelcome"
I agree with those.
or "dangerous"
I don't see that one.
or "unwieldy"
or "problemati c" would all be appropriate words.
Yes to those.
...because providing newbies with the power to post HTML into
comp.lang.c without also providing them with the wisdom not to
is not a sign of advancement, but of poverty of thought.


No, that's just your *opinion* based on your desire for a TTY text
environment.


No, it's my opinion based on my desire for a low threshold for
interoperabilit y. When I write a letter for immediate printing and posting,
I use a word processor (Lotus WordPro, if you care), with proportional
fonts, italics, colour, or whatever seems appropriate. But when I send
information to someone, I want to maximise their chance of reading it
swiftly and efficiently, without having to dig out some special software or
having to switch to a different OS. I don't send people WordPro docs unless
I know for sure that they use WordPro as their word processor of choice
(and I'm the only one I know who uses it!) Text is just about the most
portable form of computer communication there is, so I think it makes sense
for everyone to use it when interfacing with each other, except when *all*
parties to a communication agree to use some other format that (by accident
or design) they can all access.
The concept of "advanced" or "retarded" doesn't apply.
Isn't the point of TTY text a lowest common denominator environment?
Yes.
Isn't the point avoiding advanced features not supported by all?


The point is to maximise communication by minimising barriers to
communication.
So - which is better? To say to these people "please don't post in
HTML" and then help them out with their C question, or to ignore
their articles completely without even telling them why they're
being ignored?

I don't agree those are the only choices.


But you don't get to choose other people's actions for them,..


??? The reply doesn't seem to connect to the quoted bit at all.


But it is. The point I was making is simple enough. You say that there are
more choices than the two I presented. But you don't have control over the
choices people make. In practice, the two I outlined are, IMHO, the most
likely that people in clc will make. I may be wrong about that, of course,
but I don't believe I am.

--
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 #217
Richard Heathfield wrote:
vi em*

That's pretty elegant.


Thanks a lot.
Nov 13 '05 #218
Bob Chan <nospam> wrote:
Richard Heathfield wrote:
vi em*

That's pretty elegant.


Thanks a lot.


Sorry if you didn't like the answer, but I'm perfectly serious. That's
currently how I read email.

--
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 #219
Programmer Dude <Ch***@Sonnack. com> wrote:
Not intending to open another can of worms, but MIME multi-part
would (almost) solve the problem. One part plain text, one part
HTML. Everyone wins.

Except for those readers that don't do MIME, either. :-\


And except for those news servers which are decent enough to kill all
multi-part posts in non-binary newsgroups. Mine does.

Richard
Nov 13 '05 #220

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.