I'am working on delphiXE2 and i was working on PInteger. if i did this in my delphi code
var
P: PInteger;
testInt: Integer;
Scores: array[0..4] of Integer=(33,44,56,78,78);
begin
P := @Scores;
testInt := (P+1)^;
WriteLn(testInt);
ReadLn;
end;
I got this error.
[DCC Error] Project1.dpr(23): E2015 Operator not applicable to this operand type
PS: testInt := (P+1)^;
is the 23rd line
However when I try this
var
PCh: PChar;
testchar: char;
str: array[0..4] of char=('a','b','c','d','e');
begin
PCh := @str;
testchar := (PCh+1)^;
WriteLn(testchar);
ReadLn;
end;
it works well! The console can print 'b'!
I'm not clear about how could this happen and when ((Pointer)(P)+1)^ can work?