Could I safety replace pointer with call by reference? lazarus / 62-General ---------------------------------------------------------------------- jiaxing2 · 2020-05-14 06:01 It's in my C library binding. In C they use pointer. I want to know if I could substitue pointer with call by reference ---------------------------------------------------------------------- PascalDragon · 2020-05-14 07:39 In general you can. The only case where you shouldn't is if the pointer is allowed to be Nil, cause a var, out or constref parameter can not be a reference to nothing. ---------------------------------------------------------------------- LemonParty · 2020-05-14 08:19 Quote from: PascalDragon on May 14, 2020, 09:39:48 amThe only case where you shouldn't is if the pointer is allowed to be Nil, cause a var, out or constref parameter can not be a reference to nothing. No, you can. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i function F(var b: Integer): Integer;begin if @b = nil then  Writeln('nil');end; begin F(PInteger(nil)^);end. ---------------------------------------------------------------------- PascalDragon · 2020-05-14 08:32 Quote from: LemonParty on May 14, 2020, 10:19:00 amQuote from: PascalDragon on May 14, 2020, 09:39:48 amThe only case where you shouldn't is if the pointer is allowed to be Nil, cause a var, out or constref parameter can not be a reference to nothing. No, you can. Yes, but this is not obvious to most. Also you need to have a pointer type to the parameter type declared.