473,805 Members | 2,017 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
Chris Torek <no****@elf.eng .bsdi.com> wrote:

<snip>
/*
* Copy input from "in" to "txt" and "tag" output files.
* Text in <angle brackets> goes to the "tag" file, the
* rest goes to the "txt" file.
*/
int separate(FILE *in, FILE *txt, FILE *tag) {
int c;
int in_tag = 0, next_tag;

while ((c = getc(in)) != EOF) {
next_tag = in_tag;
if (c == '<')
in_tag = 1;
If you replace above line with:

in_tag = next_tag = 1;

the code actually works. ;-)
else if (c == '>')
next_tag = 0;
putc(c, in_tag ? tag : txt);
in_tag = next_tag;
}
}

<snip>

Regards
--
Irrwahn
(ir*******@free net.de)
Nov 13 '05 #231
Hmmmm... thought this thread was dying... guess not?

Ian Woods wrote:
Text *became* a universal medium.
I don't know about text 'becoming' a universal medium.


Long ago, there were an awful lot of IBM 3270/SNA terminals!
Another big item was DEC VT*** terminals. Neither were plain
text.
HTML is merely another expression of text, with tags, to say how
it should be 'marked up'.
Agreed, however the whole point is that 'mark up'.
Whether it's an HTML email or an XHTML usnet message, the majority
of the useful context still text. Why use HTML to format text when
text is already easilly formatted in not-HTML?
Because (I claim) true italics, bold & underline is more "transparen t"
(see previous posts) than their ASCII equivalents.
Anyone who says a picture is worth 1,000 words doesn't have enough
imagination... :)
Probably true, but would you rather have a map to a complicated
destination or written instructions? (Actually, this varies by
person.) The interesting thing is, a map allows you to design
alternate routes if there turns out to be a problem with the
designated one.
There's no way in hell you can eliminate the TTY, at least not
until corporations rule the world entirely.
(Ah, you've seen ROLLERBALL... :-)
Just look at what you can do on a text console which /cannot/ be
done in GUI land!


Yes, but I'm not talking about user interfaces. (And I agree very
much.) I'm talking about written communications.

--
|_ CJSonnack <Ch***@Sonnack. com> _____________| How's my programming? |
|_ http://www.Sonnack.com/ _______________ ____| Call: 1-800-DEV-NULL |
|______________ _______________ _______________ _|_____________ __________|
Nov 13 '05 #232
Richard Heathfield wrote:
All we have to do is find a programmer who advocates HTML
as a valid universal format, and ask him to produce an
HTML-aware version of grep.


You know, I'm surprised such doesn't exist. You'd think there
would be enough decent HTML parser libraries out there that it
wouldn't be very difficult.

Hmmm... wonder if there's any money in it.....

--
|_ CJSonnack <Ch***@Sonnack. com> _____________| How's my programming? |
|_ http://www.Sonnack.com/ _______________ ____| Call: 1-800-DEV-NULL |
|______________ _______________ _______________ _|_____________ __________|
Nov 13 '05 #233
Richard Heathfield wrote:
I'm thinking/guessing
HTML (or something like it) will *become* a universal medium.


I don't think it will become universal as long as programmers
are around, because the sheer flexibility that text gives you
is hard to beat.


Perhaps, but there are a LOT more non-programmers on amUSENET
these days. We're severely outnumbered!

--
|_ CJSonnack <Ch***@Sonnack. com> _____________| How's my programming? |
|_ http://www.Sonnack.com/ _______________ ____| Call: 1-800-DEV-NULL |
|______________ _______________ _______________ _|_____________ __________|
Nov 13 '05 #234
Programmer Dude wrote:
Richard Heathfield wrote:
I'm thinking/guessing
HTML (or something like it) will *become* a universal medium.


I don't think it will become universal as long as programmers
are around, because the sheer flexibility that text gives you
is hard to beat.


Perhaps, but there are a LOT more non-programmers on amUSENET
these days. We're severely outnumbered!


But we're discussing comp.lang.c, not Usenet. In the context of comp.lang.c,
I sincerely hope that there are more programmers than non-programmers.

--
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 #235
Richard Heathfield wrote:
Perhaps, but there are a LOT more non-programmers on amUSENET
these days. We're severely outnumbered!


But we're discussing comp.lang.c, not Usenet.


No, I've been talking about amUSENET.

If I'm right and HTML (or similar) does become a standard on
amUSENET, do you expect that you'll be able to keep clc TTY?

--
|_ CJSonnack <Ch***@Sonnack. com> _____________| How's my programming? |
|_ http://www.Sonnack.com/ _______________ ____| Call: 1-800-DEV-NULL |
|______________ _______________ _______________ _|_____________ __________|
Nov 13 '05 #236
Programmer Dude <Ch***@sonnack. com> wrote:
Richard Heathfield wrote:
Perhaps, but there are a LOT more non-programmers on amUSENET
these days. We're severely outnumbered!


But we're discussing comp.lang.c, not Usenet.

No, I've been talking about amUSENET. If I'm right and HTML (or similar) does become a standard on
amUSENET, do you expect that you'll be able to keep clc TTY?


What is this amuseNET you speak of? Surely it is not the same
thing as the Usenet. Perhaps the soul of the argument is that you
believe to be a part of this 'amuseNET', which obviously favors
HTML for amusement purposes.

Alex
Nov 13 '05 #237
Programmer Dude wrote:
Richard Heathfield wrote:
Perhaps, but there are a LOT more non-programmers on amUSENET
these days. We're severely outnumbered!
But we're discussing comp.lang.c, not Usenet.


No, I've been talking about amUSENET.


Usenet is off-topic in comp.lang.c. :-)
If I'm right and HTML (or similar) does become a standard on
amUSENET, do you expect that you'll be able to keep clc TTY?


If we can, then HTML (or similar) is not really a Usenet standard.

And if we can't, perhaps many of us may stop bothering to use Usenet
altogether. Perhaps we'll find other, more efficient ways of communicating.
Or perhaps we'll just stop communicating. Some, of course, will plough on
through all the tags, and I admire them for their devotion. I don't think
I'll be one of them.

--
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 #238
Alex <al*******@hotm ail.com> wrote in message news:<bp******* ******@ID-190529.news.uni-berlin.de>...
Programmer Dude <Ch***@sonnack. com> wrote:
Richard Heathfield wrote:

Perhaps, but there are a LOT more non-programmers on amUSENET
these days. We're severely outnumbered!

But we're discussing comp.lang.c, not Usenet.

No, I've been talking about amUSENET.

If I'm right and HTML (or similar) does become a standard on
amUSENET, do you expect that you'll be able to keep clc TTY?


What is this amuseNET you speak of? Surely it is not the same
thing as the Usenet. Perhaps the soul of the argument is that you
believe to be a part of this 'amuseNET', which obviously favors
HTML for amusement purposes.


afaik, Dude /does/ partake of serious conversation son usenet,
but has seen so many ridiculous/ludicrous arguments that he
prefers to call it "amuse-net" (emphasis on amuse).

hth
goose,
Nov 13 '05 #239
Programmer Dude <Ch***@Sonnack. com> wrote:
Richard Heathfield wrote:
Perhaps, but there are a LOT more non-programmers on amUSENET
these days. We're severely outnumbered!


But we're discussing comp.lang.c, not Usenet.


No, I've been talking about amUSENET.


Well, you're right, there: on alt.fan.schildt HTML is probably
acceptable and on-topic. On comp.lang.c it is not, thank heavens.

Richard
Nov 13 '05 #240

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.