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.

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


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

There are many different encoding types for strings, look at all PtrToString(()