Char
program PChar1;
{$APPTYPE CONSOLE}
uses
Windows, SysUtils;
var
s: String;
begin
WriteLN('Geben sie einen Text ein:');
Readln(s);
MessageBox(0, PChar(s), 'String-Konstante', MB_OK);
end.
Const
program PChar2;
{$APPTYPE CONSOLE}
uses
Windows,
SysUtils;
var
s: String;
begin
WriteLN('Geben sie einen Text ein:');
Readln(s);
MessageBox(0, @s[1], 'String-Konstante', MB_OK);
end.
Pointer
program PChar3;
{$APPTYPE CONSOLE}
uses
Windows,
SysUtils;
var
s: String;
begin
WriteLN('Geben sie einen Text ein:');
Readln(s);
MessageBox(0, Pointer(s), 'String-Konstante', MB_OK);
s := '';
end.
Keine Kommentare:
Kommentar veröffentlichen