Re: Class Instances

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



"Jon Skeet [C# MVP]" <skeet@xxxxxxxxx> schrieb im Newsbeitrag
news:MPG.20d6fcc535c769261fe@xxxxxxxxxxxxxxxxxxxxxxx
Gino <someone@xxxxxxxxxxxxx> wrote:
The first part of the statement, "newClass ras" creates a varible "ras"
of
type "newClass" on the stack.
It's value is set to null.

No - its value is unassigned, at least as far as the C# language is
concerned. An implementation could choose to clear the memory, but it
doesn't have to, as far as I'm aware. You won't be able to "see" the
contents of the memory until it's been definitely assigned anyway.

Actually a 'debuggable' builds (in most cases that build from
'DEBUG'-Configuration), its preset with null. But only, so that the debugger
has something to show, if it's stop before the assignment and the programm
has a specific behavior if the execution point is changed through the
debugger.

Conceptually local variables don't have initial values (if they aren't
initialized explicitly.)

Christof


.



Relevant Pages

  • Re: Is it possible to use the value of the PROGRAM ID within the source code?
    ... > Now you claim the language's 'hiding' features make the stack invisible to ... EXIT, RETN, and the setting of the RCW on ENTR are independent of language. ... Moreover, precisely because memory *is* dynamically allocated, there is no ... any Unisys MCP customer is welcome to file a New Feature Suggestion ...
    (comp.lang.cobol)
  • Re: hacker challenge - traverse a list
    ... in order only using Oadditional memory. ... can't use recursion or simulate it with a stack. ... Use whatever language ... Scanning list structures without stacks or tag bits. ...
    (comp.programming)
  • Re: hacker challenge - traverse a list
    ... in order only using Oadditional memory. ... can't use recursion or simulate it with a stack. ...  We don't need no steenking rules! ...  Use whatever language ...
    (comp.programming)
  • Re: Stack Allocations: Reserve/Commit...
    ... JHR> device I'm using so I'll need to grab another model. ... JHR> aborts as the program loads; I guess it's a memory isssue. ... Each thread in your application consumes "Reserve" stack size of virtual ... impossible to debug it as it's controlled by ActiveSync (EVC debugger ...
    (microsoft.public.windowsce.embedded.vc)
  • Re: pop quiz for Forth novices
    ... the memory allocation words that Forth provides. ... That doesn't require an addition to the language ... least one C implementation that didn't use a stack. ... Many C programs have their own memory allocator. ...
    (comp.lang.forth)