[Solved] How to resolve errors with unsafe pointer in C#? [closed]

Your code (corrected): public static unsafe bool ExistInURL(params object[] ob) { byte* voidPtr = stackalloc byte[5]; *((int*)voidPtr) = 0; while (*(((int*)voidPtr)) < ob.Length) { if ((ob[*((int*)voidPtr)] == null) || (ob[*((int*)voidPtr)].ToString().Trim() == “”)) { *((sbyte*)(voidPtr + 4)) = 0; goto Label_004B; } (*(((int*)voidPtr)))++; } *((sbyte*)(voidPtr + 4)) = 1; Label_004B: return *(((bool*)(voidPtr + 4))); } instead … Read more