home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.pascal.borland      Borland Pascal was actually pretty neat      2,978 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 1,906 of 2,978   
   Marco van de Voort to Alex C   
   Re: Problem converting C pointer   
   21 Sep 05 16:34:12   
   
   From: marcov@stack.nl   
      
   On 2005-09-21, Alex C  wrote:   
   > I want to convert the folowing two lines into delphi. Unfortunately,   
   > I'm even worst than a newbie in C so I request your help   
      
   Try a delphi group, this group is about Delphi's ancestors;   
      
   > BYTE *pbDataInput =(BYTE *)"Hello world of data protection.";   
   > DWORD cbDataInput = strlen((char *)pbDataInput)+1;   
      
   I'll provide the Turbo Pascal equivalent.   
      
   Uses Strings;   
      
   TYPE PByte = ^Byte;   
      
   Const bDataInput= 'Hello World of data protection'#0;   
      
   var cbDataInput : integer;   
       pbDataInput : PByte;	   
      
      
   begin   
    pbDataInput:=PByte(@bDataInput[1]);   
    cbDataInput:=StrLen(@bDataInput[1])+1;   
   ..   
      
      
   P.S. in Delphi you can leave away the #0   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca