Stopbyte

What's The Equivalent Of C size_t In C#?

Hi,

I am trying to add an unmanaged structure (defined already in C programming language) to my C# Applicationā€¦ And I came across this type called size_t :confused:

And I couldnā€™t find any equivalent of that type within C#, So what should I use to replace size_t?!

Thanks!

1 Like

hmmā€¦ size_t is a platform dependent type, So in some platforms Itā€™s equivalent to uint while in others itā€™s equivalent to ulong.

But I believe as commonly known UIntPtr Is the .Net Framework Type that best fits with size_t. But there is no guarantee of that documented anywhere. as far as I know.