delphi - Can multiple string variables really refer to the same data? -


According to information on the internet I found out that point to the same location in the following two variables memory.

What is giving it can show that it is true (see, for example by changing one letter in one variable and this change appears on the other variables)?

  Process TForm1.Button1Click (Sender: Tubbed); Var a, b: string; Start one: = 'test'; B: = A; Shomeses (A); Shomeses (B); End;    

  var a, b: string; Start one: = 'test'; A: = a + '!'; // Added after the comment of Rob, // ensures a digit for allocation on the heap b: = a; PCHAR (B) [3]: = 'T'; ShowMessage (a); // -> testing! End;    

Comments