@MarkMLl in context of declaring variable. In C, you can declare mutable pointer with immutable content.
Pascal doesn't have the ability to decide whether the content should be immutable or not. The closest is the following:
program tstrtest;
var
p: PChar = 'Hello World';
begin
p[0] := 'P';
end.
Writing to the content of
p will trigger an exception, because the
'Hello World' string data will reside in a read only section (if the OS as well as the assembler support it). However as soon as you change
p to something that is dynamically allocated there won't be any exception.
Declaring
p as a
const instead of a
var together with
$WriteableConsts Off as
lucamar showed will lead to a
p variable that cannot be changed.