随笔 - 2146  文章 - 97 评论 - 11767 trackbacks - 253

//指针的运算仅对 PChar 类型
procedure TForm1.Button1Click(Sender: TObject);
var
  p: PChar;
begin
  p := 'China';
  Inc(p);
  p := p + 1;
  ShowMessage(p);  //返回:ina

  Dec(p);
  p := p - 1;
  ShowMessage(p);  //返回:China
end;
posted on 2007-11-30 21:19  万一  阅读(...)  评论(...编辑  收藏