new(a_SendMsg);
       a_SendMsg^:=Read_SendMsg(stream);
       Msg_Body:=a_SendMsg;
请问这3行代码应该怎样理解?

解决方案 »

  1.   

    new给指针分配内存。 这样才能对指针操作。
      

  2.   

    a_SendMsg^:=Read_SendMsg(stream)
    中的
    a_SendMsg^
    是不是代表指针所指地址的值,还是内存中的数据值??
      

  3.   

    1.new给指针分配内存。 这样才能对指针操作
    2.a_SendMsg^指针中存放的地址是Read_SendMsg(stream)
    读入流的首地址.
    3.指针的赋值
    procedure New(var P: Pointer);DescriptionThe New procedure creates a new dynamic variable and sets a pointer variable to point to it. P is a variable of any pointer type. The size of the allocated memory block corresponds to the size of the type that P points to. The newly created variable can be referenced as P^. If there isn't enough memory available to allocate the dynamic variable, an EOutOfMemory exception is raised.When an application is finished using a dynamic variable created with New, it should dispose of the memory allocated for the variable using the Dispose standard procedure.