About Lists of Pointers

From: Steve B (steve_at_www.www)
Date: 10/28/03


Date: Tue, 28 Oct 2003 16:01:50 +0000

procedure TMainForm.Proc1;
var
   C: Char;
begin
   C := 'A';
   FStack.Push(Pointer(C));
end;

procedure TMainForm.Proc2;
begin
   ShowMessage(Char(FStack.Pop));
end;

In Proc1, the address of a local variable is pushed. So why is the
address still valid in Proc2?

TIA



Relevant Pages

  • Re: Calculate the string statement
    ... verkn:(vkn:char; ... funkt:(fkt:string; ... var fkt,dfkt: p; ... var fehler: boolean; ...
    (comp.lang.pascal.borland)
  • Re: Evaluate constant parts of expressions in Linq
    ... I have column MyCharColumn of type CHAR in database. ... var q = from p in db.Products ... To fix compile error I changed query to ... How to fix without using temporary string variable? ...
    (microsoft.public.dotnet.languages.csharp)
  • Passing void pointer to p_thread that is a Char
    ... where var is a char variable. ... test.c:58: warning: cast to pointer from integer of different size. ... Now I thought that when it was a void I could pass anything? ... works when I use an int, but in this case I wanted to use a char. ...
    (comp.lang.c)
  • Re: Passing void pointer to p_thread that is a Char
    ... where var is a char variable. ... works when I use an int, but in this case I wanted to use a char. ... Im trying to pass a void thats a char. ...
    (comp.lang.c)
  • Re: pre startup initialization
    ... > practice this is only really a problem for static libraries (which ... extern bool IsLoading; ... FILE& operator,(FILE& file, char var); ...
    (comp.lang.cpp)