Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > about structures memory allocation

Reply
Thread Tools

about structures memory allocation

 
 
Johan Bengtsson
Guest
Posts: n/a
 
      06-25-2007
Keith Thompson wrote:
> Ok, so what exactly is the issue? I think I've lost track.
>
> I think we all know what the answers are, and we're arguing over what
> the question is, or perhaps what the question should be.
>

<OT_HUMOR>42</OT_HUMOR>

(For those not understanding: you need to read Douglas Adams book
"hitchhikers guide to the galaxy")

Could not resist... sorry

 
Reply With Quote
 
 
 
 
Flash Gordon
Guest
Posts: n/a
 
      06-25-2007
Johan Bengtsson wrote, On 25/06/07 19:17:
> Keith Thompson wrote:
>> Ok, so what exactly is the issue? I think I've lost track.
>>
>> I think we all know what the answers are, and we're arguing over what
>> the question is, or perhaps what the question should be.
>>

> <OT_HUMOR>42</OT_HUMOR>


That's the answer, not the question! Now we can't post the question here
without the universe being replaced by something even more incomprehensible!

> (For those not understanding: you need to read Douglas Adams book
> "hitchhikers guide to the galaxy")


The radio series is IMHO the best version

> Could not resist... sorry


Life, don't talk to me about life.
--
Marvin
I'll just go and stick my head in a bucket of water. I've got one here.
 
Reply With Quote
 
 
 
 
Richard Bos
Guest
Posts: n/a
 
      06-26-2007
Flash Gordon <(E-Mail Removed)> wrote:

> Johan Bengtsson wrote, On 25/06/07 19:17:
> > Keith Thompson wrote:
> >> Ok, so what exactly is the issue? I think I've lost track.
> >>
> >> I think we all know what the answers are, and we're arguing over what
> >> the question is, or perhaps what the question should be.
> >>

> > <OT_HUMOR>42</OT_HUMOR>

>
> That's the answer, not the question! Now we can't post the question here
> without the universe being replaced by something even more incomprehensible!


That has already happened. In 1999, to be precise.

Richard
 
Reply With Quote
 
Flash Gordon
Guest
Posts: n/a
 
      06-26-2007
Richard Bos wrote, On 26/06/07 07:24:
> Flash Gordon <(E-Mail Removed)> wrote:
>
>> Johan Bengtsson wrote, On 25/06/07 19:17:
>>> Keith Thompson wrote:
>>>> Ok, so what exactly is the issue? I think I've lost track.
>>>>
>>>> I think we all know what the answers are, and we're arguing over what
>>>> the question is, or perhaps what the question should be.
>>>>
>>> <OT_HUMOR>42</OT_HUMOR>

>> That's the answer, not the question! Now we can't post the question here
>> without the universe being replaced by something even more incomprehensible!

>
> That has already happened. In 1999, to be precise.


Yes, but we don't want the situation getting any worse!
--
Flash Gordon
 
Reply With Quote
 
Army1987
Guest
Posts: n/a
 
      06-28-2007

"Keith Thompson" <(E-Mail Removed)> ha scritto nel messaggio news:(E-Mail Removed)...
> CBFalconer <(E-Mail Removed)> writes:
>> Army1987 wrote:
>>>

>> ... snip ...
>>>
>>> In something like
>>> int main(void) {
>>> struct bharath b;
>>> long long ll;
>>> ...
>>> }
>>> since the standard requires nothing about the placement of auto
>>> variables, it is well possible that there is some space between
>>> b and ll, but an auto char in an inner block might well be put into
>>> that space. (Yes, I don't think it is very likely to happen...)
>>> So, as far as a reasonable definition of "to allocate" is
>>> concerned, these two declarations allocate exactly sizeof b +
>>> sizeof ll bytes, even if they are not contiguous.

>>
>> A long long requires <sizeof long long\> bytes, not 11.

>
> Chuck, if you can't tell the difference between "l" (lowercase L) and
> "1" (digit one), get a better font. At least take a closer look
> before assuming that somebody wrote something nonsensical like "sizeof
> 11". (Yes, "sizeof 11" is legal, but it makes no sense in context.)


And it is very unlikely to be 11 bytes.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
An idea for heap allocation at near stack allocation speed Bjarke Hammersholt Roune C++ 14 03-06-2011 08:07 AM
Allocation of a multidimensional array of structures Michel Rouzic C Programming 14 06-24-2007 06:31 PM
static memory allocation versus dynamic memory allocation Ken C Programming 24 11-30-2006 12:37 AM
What is the difference between dynamic memory allocation,and stack allocation ? chris C++ 6 10-28-2005 05:27 AM
structures, structures and more structures (questions about nestedstructures) Alfonso Morra C Programming 11 09-24-2005 07:42 PM



Advertisments