convert piece of code from C++ to C#
-
I have a piece of code in c++ and I want to know how it can be in C# : int m_it[MAX_BC]; int m_iKe[MAX_ROUNDS][MAX_BC]; char const* a_pchIn; int* pi = m_it; for(i=0; i<8; i++) { *pi = ((unsigned char)*(a_pchIn++) << 24); *pi |= ((unsigned char)*(a_pchIn++) << 16); *pi |= ((unsigned char)*(a_pchIn++) << 8); (*(pi++) |= (unsigned char)*(a_pchIn++)) ^= m_iKe[0][i]; } In C# ? Thank you
-
I have a piece of code in c++ and I want to know how it can be in C# : int m_it[MAX_BC]; int m_iKe[MAX_ROUNDS][MAX_BC]; char const* a_pchIn; int* pi = m_it; for(i=0; i<8; i++) { *pi = ((unsigned char)*(a_pchIn++) << 24); *pi |= ((unsigned char)*(a_pchIn++) << 16); *pi |= ((unsigned char)*(a_pchIn++) << 8); (*(pi++) |= (unsigned char)*(a_pchIn++)) ^= m_iKe[0][i]; } In C# ? Thank you
This answer might erk a few programmers here in Discussions, but I can recall having a moderate amount of success taking C++ code verbatim and pasting it as C# code in the C# code behind module I was working on, attempting a compile, THEN ACTUALLY working from the compiler error list to clear the syntax breaks while F2-ing the HELP tome. 'Might try this if you find no other solution ...