Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there any analog of the void type used in C/C++? 1

Status
Not open for further replies.

apostolchopov

Programmer
Jun 8, 2004
53
BG
Hi, fellows!

Could you tell me, please, is there any analogue in Delphi of the void type used in C/C++? I would like to use a value of the void type (as comprehended in C/C++) as parameter of a procedure/function. How to implement this in Delphi, if possible?
 
I understand that the Pointer type is the equivalent of the C++ void* type.

Here is an example of its use:
Code:
procedure subroutine( p: pointer );
var
  z: integer;
begin
  z := integer(p^);
  ShowMessage ( IntToStr(z) );
end;

procedure TForm1.Button1Click(Sender: TObject);
var
  x: integer;
  p: pointer;
begin
  x := 21;
  p := addr(x);
  subroutine( p );
end;

Andrew
Hampshire, UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top