De-Referencing A Pointer

Oskar Linde oskar.lindeREM at OVEgmail.com
Tue Mar 21 00:00:15 PST 2006


Rory Starkweather skrev:
> Still working on a VB to D DLL interface. I want to pass a string to a D
> function. The only way I have been able to do it without errors is ByRef on the
> VB end, as expected, to a char* on the D end. However, I want to use the 'find'
> function on the string. 'find' requires a char[] and a dchar as inputs. I
> I haven't been able to figure out how to de-reference the pointer for the char[]
> and I don't know how to produce a dchar. 

a char* cStr is converted to char[] by

cStr[0..std.c.string.strlen(cStr)]

or

std.string.toString(cStr)

/Oskar



More information about the Digitalmars-d-learn mailing list