Porting C++ to C#: Types
-
I'm trying to port a C++ algorithm to C#, and Im ust say, this is my first time doing so. Would anyone care to list the corresponidng types from C++ to C#? I've already made some guesses as to what they are: size_t (I assume it is System.Int32) uchar_t (I assume it is System.Byte) uint16_t (UInt16 definitely) Also, I don't think C# can have the void type in a method's parameter list. Method(void *sStart, size_t sLen, void *dStart, size_t dLen) This one line has me puzzled. Thanks in advance.
ROFLOLMFAO
-
I'm trying to port a C++ algorithm to C#, and Im ust say, this is my first time doing so. Would anyone care to list the corresponidng types from C++ to C#? I've already made some guesses as to what they are: size_t (I assume it is System.Int32) uchar_t (I assume it is System.Byte) uint16_t (UInt16 definitely) Also, I don't think C# can have the void type in a method's parameter list. Method(void *sStart, size_t sLen, void *dStart, size_t dLen) This one line has me puzzled. Thanks in advance.
ROFLOLMFAO
You can use as Object
Parwej Ahamad g_parwez@rediffmail.com
-
You can use as Object
Parwej Ahamad g_parwez@rediffmail.com
If possible, I would like to avoid object. Object doesn't even make sense since they are all value types.
ROFLOLMFAO
-
I'm trying to port a C++ algorithm to C#, and Im ust say, this is my first time doing so. Would anyone care to list the corresponidng types from C++ to C#? I've already made some guesses as to what they are: size_t (I assume it is System.Int32) uchar_t (I assume it is System.Byte) uint16_t (UInt16 definitely) Also, I don't think C# can have the void type in a method's parameter list. Method(void *sStart, size_t sLen, void *dStart, size_t dLen) This one line has me puzzled. Thanks in advance.
ROFLOLMFAO
Behind The Scene wrote:
Also, I don't think C# can have the void type in a method's parameter list. Method(void *sStart, size_t sLen, void *dStart, size_t dLen)
The data type is not "void", it's "void*". It's an unspecified pointer.
--- single minded; short sighted; long gone;
-
If possible, I would like to avoid object. Object doesn't even make sense since they are all value types.
ROFLOLMFAO
Ok, you can use void * pointer in c#
Parwej Ahamad g_parwez@rediffmail.com
-
Behind The Scene wrote:
Also, I don't think C# can have the void type in a method's parameter list. Method(void *sStart, size_t sLen, void *dStart, size_t dLen)
The data type is not "void", it's "void*". It's an unspecified pointer.
--- single minded; short sighted; long gone;
Right, and a typeless pointer value in C# is an IntPtr. :)
Luc Pattyn [My Articles]