sizeof() and a structure

G

George Orwell

Hey, srikar :) Sorry you had to be exposed to CLC smugness. They
all think they're Ritchies or Stallmans around here.
Yes, you do.

Yes, if you want to distort srikar's perfectly clear meaning into
something else.
There is no reason to suppose that the size of a struct node is
sizeof(data) + sizeof(*next).

Yes, especially since the size of a struct node /is/ sizeof(*next);
(Refer to those elementary C books, which you should have checked
before posting.) We'd want sizeof(data) to be 0, wouldn't we?
You have made a completely unwarranted assumption.
The size of an object is _at least_ the sum of the sizes of the named
parts of it.

Are unions objects, Martin? (Sorry, this is CLC.)
Usually to padding.

And otherwise to what?
This is covered in all elementary C texts (and in
the FAQ, which you should have checked before posting).


Another user of bill-collector language.

Another smug CLC poster goes pop.

Yours,
Han from China


--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999

Il mittente di questo messaggio|The sender address of this
non corrisponde ad un utente |message is not related to a real
reale ma all'indirizzo fittizio|person but to a fake address of an
di un sistema anonimizzatore |anonymous system
Per maggiori informazioni |For more info
https://www.mixmaster.it
 
S

srikar2097

I thank one and all for clarifiying this fo me. I realize that most of
you here are
experts in C and my queries here might seem a bit too easy. But I'm
trying to learn
this language and thanks for taking the time out...

Srikar
 
R

Richard Bos

srikar2097 said:
I thank one and all for clarifiying this fo me.

Do note that the person you just replied to is a troll. And someone who
doesn't know how to use his anonymiser correctly.
George Orwell wrote:
[snip!]
Another smug CLC poster goes pop.

Yours,
Han from China


--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999

Il mittente di questo messaggio|The sender address of this
non corrisponde ad un utente |message is not related to a real
reale ma all'indirizzo fittizio|person but to a fake address of an
di un sistema anonimizzatore |anonymous system
Per maggiori informazioni |For more info
https://www.mixmaster.it

Oops...

Richard
 
C

CBFalconer

srikar2097 said:
I thank one and all for clarifiying this fo me. I realize that
most of you here are experts in C and my queries here might seem
a bit too easy. But I'm trying to learn this language and thanks
for taking the time out...

Then please do not top-post. Your answer belongs after (or
intermixed with) the quoted material to which you reply, after
snipping all irrelevant material. See the following links:

<http://www.catb.org/~esr/faqs/smart-questions.html>
<http://www.caliburn.nl/topposting.html>
<http://www.netmeister.org/news/learn2quote.html>
<http://cfaj.freeshell.org/google/> (taming google)
<http://members.fortunecity.com/nnqweb/> (newusers)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top