Connecting Tech Pros Worldwide Forums | Help | Site Map

What is the equivalent of function 'print_string_list' in C#

BuddyWork
Guest
 
Posts: n/a
#1: Nov 17 '05
Hello can someone let me know how to convert a INTPTR (which is a
pointer to a C string array, each string is null terminated and there
is a double null terminator at the end which states the end of the
pointer).


Ignacio Machin \( .NET/ C# MVP \)
Guest
 
Posts: n/a
#2: Nov 17 '05

re: What is the equivalent of function 'print_string_list' in C#


Hi,

Is all the data in a consecutive chunk of memory?

If so what you can do is copy it to a byte[] then using a StringBuilder you
iterate in it , when you find a 0 you reached the end of a string and you
just print/do whatever with it and then restart again.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation



"BuddyWork" <dhirani@bankofny.com> wrote in message
news:1124719496.193989.64300@g44g2000cwa.googlegro ups.com...[color=blue]
> Hello can someone let me know how to convert a INTPTR (which is a
> pointer to a C string array, each string is null terminated and there
> is a double null terminator at the end which states the end of the
> pointer).
>[/color]


Ignacio Machin \( .NET/ C# MVP \)
Guest
 
Posts: n/a
#3: Nov 17 '05

re: What is the equivalent of function 'print_string_list' in C#


Hi,

Is all the data in a consecutive chunk of memory?

If so what you can do is copy it to a byte[] then using a StringBuilder you
iterate in it , when you find a 0 you reached the end of a string and you
just print/do whatever with it and then restart again.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation



"BuddyWork" <dhirani@bankofny.com> wrote in message
news:1124719496.193989.64300@g44g2000cwa.googlegro ups.com...[color=blue]
> Hello can someone let me know how to convert a INTPTR (which is a
> pointer to a C string array, each string is null terminated and there
> is a double null terminator at the end which states the end of the
> pointer).
>[/color]


Closed Thread