I get a variable that is a int and a pointer (address) to a string (Byte*) in c++
I've been struggling like for 3 days in order to turn this into a Byte array. I have no clue how long would be that string so I know I'll have to iterate till I get \0 or end of string.

Can someone please guide me by showing a code example (unsafe) I guess or marshal.

thanks.
Oh yeah, I am trying to achieve all this in c#.

System.Runtime.InteropServices.Marshal.PtrToStringAnsi()

It accepts a pointer and an integer as parameters to read the string

[edit]
There are many different encoding types for strings, look at all PtrToString(()
[/edit]

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.