Hi

I am having hard time understanding pointers, addr, cstrings.
    
    
    var i: cstring = "a"
    var pi: ptr cstring = i.addr
    echo repr(i)
    echo repr(pi)
    

Output: 
    
    
    005BC058"a"
    ref 004477F8 --> 005BC070"a"
    

My understanding is this. First we declare variable i and assign string "a" 
there. As first line of output says, "a" is kept in ...058 cell of memory so in 
fact i contains address of this cell. Now we are declaring pointer pi and 
assign address of i. Is it that pi points to i that points to ...058 memory 
which contains "a"? As I understand from second ouput line address of pi 
variable is ...77F8, but then it is suggesting that "a" is in memory cell C070. 
I am a bit confused. Could you help me understand? 

Reply via email to